question

shashi avatar image
shashi asked

Verification emil send through Script should run only one time.

Hi,

Following is the "cloud script" to trigger the send email verification to the user , When I run this script for particular playfab user, it continuosly sending me the email. Where as this should be run only one time.

/*

@ Method Name:callForSendingVerificationEmail

@ Descripion: Verification email send to the contact email.

@ Created At : 25-09-2018

*/

handlers.callForSendingVerificationEmail = function (args, context) {

var response = server.SendEmailFromTemplate({

EmailTemplateId: "237D91B7AD8391A0",

PlayFabId: currentPlayerId

});

var message ="Verification email send to the contact email with PlayFabId => "+ currentPlayerId return {

messageValue: message,response:response

};

}// End function

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The SendEmailFromTemplate call only sends one email. If a mail is being sent to a single player multiple times, there has to be an Action or similar which is causing this. What is your Title ID, so that we can have a look?

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shashi avatar image shashi commented ·

Thanks, for response I also share the script in start, even my Title Id = 764D

0 Likes 0 ·
brendan avatar image brendan shashi commented ·

If you filter your Dashboard API calls graph on SendEmailFromTemplate, you'll see that you were indeed making thousands of email requests for those users, which implies you've got a loop in your logic somewhere:

I notice that the success callback on your email template calls api/users/newregistration on your server. What is the result of that call? Is it possible it's resulting in another call to send the email?

0 Likes 0 ·
capture.png (34.7 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.