Add userEmail() or field to dialog
This is my script to send an email, how do I add the userEmail() or field to it to show the sender email or field content please?
let title := "Send Email";
let message := "Do you need to add a CC?
If you do click 'Yes, I do' and add it.";
let answerOptions := ["Yes, I do", "No, I don't"];
if dialog(title, message, answerOptions) = "No, I don't" then
sendEmail({
from: "alan@xxxxxxxxx.com",
to: 'EMAIL TO',
cc: CC,
subject: 'WORK REPORT OF',
text: "REPORT" + "
" + "
" + REPORT
});
alert("Email Sent!")
end
5 replies
-
Not sure if I understand your question...
Do you want to know who the user is with the userEmail() function and display his email in a formula field? Do you want it to popup in your dialog? Do you want to use his email to send the actual email?
I believe your code also doesn't work if the answer in "Yes, i do". May I suggest following code?
let sender := userEmail(); let CR := urlDecode("%0D%0A"); let ccReceiver := ""; let responce := dialog("Send Email","Do you need to add a CC?"+CR+"If you do click 'Yes, I do' and add it.",["Yes, I do", "No, I don't"]); if responce = "Yes, I do" then ccReceiver := CC end; sendEmail({ from: sender, to: 'EMAIL TO', cc: ccReceiver, subject: 'WORK REPORT OF', text: "REPORT" + " " + " " + REPORT }); alert(sender + "> sent an email to: " + CR + 'EMAIL TO' + CR + ccSender)
You may also check this tread for an example of sending emails.
Steven
Content aside
- 2 yrs agoLast active
- 5Replies
- 122Views
-
2
Following