help please on this script
The following works but not fully. None of the text: >>>
Is outputted in the email. Can someone please point out where my error is.
let myPdf := printAndSaveRecord(this, "TASKS");
let myName := "New Task.pdf";
importFile(this, myPdf, myName);
'EMAIL SENT' := true;
let myEmail := userEmail(user());
sendEmail({
from: userEmail(),
to: userEmail(),
cc: " ",
bcc: " ",
subject: "A new Task has been added for: " +
concat('ASSIGNED ENGINEERS'.'ASSIGNED ENGINEER(S)') +
" " +
'TASK TITLE',
html: 'DESCRIPTION OF TASK',
text: "Att: " + concat('ASSIGNED ENGINEERS'.'ASSIGNED ENGINEER(S)') +
"
" +
"
" +
"Please refer to the attached" +
"
" +
"
" +
"
" +
"Kind Regards" +
"
" +
"
" +
userName() +
" " +
"
" +
" ",
attachments: file(this, myName)
})
10 replies
-
Hi Alan
Not sure I can solve the issue for you but I would start by tidying up the code so the the sendEmail() command is easy to understand
let CR := " "; let myPdf := printAndSaveRecord(this, "TASKS"); let myName := "New Task.pdf"; importFile(this, myPdf, myName); let emailSubject := "A new Task has been added for: " + concat('ASSIGNED ENGINEERS'.'ASSIGNED ENGINEER(S)') + " " + 'TASK TITLE'; let emailText := "Att: " + concat('ASSIGNED ENGINEERS'.'ASSIGNED ENGINEER(S)') + CR + CR + "Please refer to the attached" + CR + CR + CR + "Kind Regards" + CR + CR + userName() + " " + CR + " "; sendEmail({ from: userEmail(), to: userEmail(), cc: " ", bcc: " ", subject: emailSubject, html: 'DESCRIPTION OF TASK', text: emailText, attachments: file(this, myName) }); 'EMAIL SENT' := true
Not sure what happens if both HTML and text are defined. Are both sent, or only one of them?
Regards John
-
Hmmm, not sure why that would be. Can you post the full snippet of code.
-
said:
html: 'DESCRIPTION OF TASK',This should read:
html: "DESCRIPTION OF TASK",
or if not intending to use the html tag:
html: "",
[Note the use of double quotes]...
Also, either remove your cc and bcc (if not in use) or set them to empty:
cc: "",
bcc: "",
your code has spaces between the quotes.
Kind regards, Andrew
-
Hi all - I used Description.... to replace null which did not work. I do not want any HTML at all so I will use "" with no space. I tweaked to script for cc and bcc to leave out personal info.
Will give this a try out as I have not heard from Ninox at all. They asked for an invite but so far have not accepted it. -
Thanks guys this seems to have worked perfectly!!
Content aside
- Status Answered
- 4 mths agoLast active
- 10Replies
- 67Views
-
3
Following