We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

rudy hadoux • 6 years ago

Interesting. Thanks.

yumin su • 6 years ago

will this work for email verification link as well?

Mohammad Khalid • 6 years ago

You can use email verification code instead of the link, then you will be able to add the "CustomMessage_SignUp" trigger source.
You have to add another if statement to the beautiful code above:
else if(event.triggerSource === "CustomMessage_SignUp") {event.response.emailMessage = ''; //your message}

Develobear • 6 years ago

Yup, the event.triggerSource is the key here!

Daniel Ramirez • 2 years ago

This does not work anymore, for some reason when using the template of this post the emails send by Cognito will completely ignore the html and use the default message body configured on the Cognito "Messaging section" of your User Pool

Donaldo Gómez • 3 years ago

hey bro I have made the same thing that you but the css style works only in mail by apple, in gmail and others email clients don´t works, have you any solution for that?

Anthony • 5 years ago

Thanks for the post! Really helped me out. One additional step I had to do to get the lambda to fire off for my webpage is to add the trigger to the intended user pool in Cognito. Under General settings there is a Triggers section, I had to add my lambda call to the Custom message box in order for AWS to send custom forgot password emails.

Karan • 5 years ago

This is a great article. I tried it with linkParameter, rather than codeParameter for signUp, and Cognito still seems to send the basic text with normal link. Any other changes I would need to do than the ones above? I mean, should the ${event.request.linkParameter} be the href on an anchor tag for a button? Because that does not seem to work for me

Chris Short • 5 years ago

I'm running in to the same issue! linkParameter does not work in regular browser based clients, however will work in desktop clients that I've tried with. It seems the url ends up returning a weird format as "https:/" with only one backslash. I'm thinking this malformed url is the reason the web clients don't allow it to show as a regular link"

aMAIzing Moves • 6 years ago

thank you for documenting this. I will try it today - hope i make it work.

Mohammad Khalid • 6 years ago

Thank you very much. You saved me a lot of time !!

Develobear • 6 years ago

Hey, wow! I'm really glad I could help you!
You're right, it took a lot of time to find that 😄