TypeError: strapi.plugins.users-permissions.services.sendConfirmationEmail is not a function

System Information
  • Strapi Version: 3.6.2
  • Operating System: Ubuntu 20.04
  • Database: MongoDB
  • Node Version: 14.17.0
  • NPM Version: 6.14.3
  • Yarn Version: 1.22.10

Hi I am creating user from my custom controller and post creating the user, i want to send the confirmation email to user but when i try to call the sendConfirmation email plugin it gives me the below error :
TypeError: strapi.plugins.users-permissions.services.sendConfirmationEmail is not a function
Location of my controller is in api/account/controllers/account.js and i am calling the function to send the email like this : await strapi.plugins['users-permissions'].services.user.sendConfirmationEmail(user)

Please help me to understand what am i doing wrong?


Hi, I had the same issue but I wasn’t using right
I had this
strapi.plugins['users-permissions'].services.sendConfirmationEmail(user)

When It should have been this
strapi.plugins['users-permissions'].services.user.sendConfirmationEmail(user)