The CreatorCon Call for Content is officially open! Get started here.

Set the Notification reply to and from fields using current

Stacy1
Mega Guru

I know I can just put a name an address in the From and Reply fields, but I need to pull the user's name that is on my form.

I have created an email script.

I can get the email to show up, but I am unable to replace the 'Display Value'.   I want it to pull the persons name and their email.

This is what I am using and I am getting the email to change but I do not know how to get the display name also.

email.setReplyTo(current.u_provisioner.email);

email.setFrom(current.u_provisioner.email);

If I change it to this, then the reply to and from just puts the system emails info.

email.setReplyTo(current.u_provisioner.email, current.u_proivisioner.name);

email.setFrom(current.u_provisioner.email, current.u_proivisioner.name);

I have tested putting in a display value like this, but that does not work either.

email.setReplyTo(current.u_provisioner.email, "my name");

email.setFrom(current.u_provisioner.email, "my name");

I have tried it after the email and in front of the email with no luck.

Any help would be greatly appreciated.

Thanks,

Stacy

1 ACCEPTED SOLUTION

Use email.setFrom(current.u_provisioner.name+' <'+current.u_provisioner.email+'>');



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

4 REPLIES 4

SanjivMeher
Kilo Patron
Kilo Patron

It should be in followng format



email.setFrom("Display Name <some.address @ company.com>");


email.setReplyTo("Display Name <some.address @ company.com>");



Please mark this response as correct or helpful if it assisted you with your question.

That works if I have that info, but when I am trying to use variables how do I put that in there?



email.setFrom("current.u_provisioner.name <current.u_provisioner.email>");



I don't think that will work.



Thanks,


Stacy


Use email.setFrom(current.u_provisioner.name+' <'+current.u_provisioner.email+'>');



Please mark this response as correct or helpful if it assisted you with your question.

You are my hero, thank you 🙂