I would like to use the fpmi.net.sendEmail(“djtemail","email@example.com”,subject,body,0,recipients) to send emails from an FPMI page. On this page I would have 10 check boxes with certain peoples names in them. When you place a checkmark in the box next to that persons name they are included in the list to receive the email.
If I place a checkmark in all the boxes, when the script is ran it sends the email. However if I unselect one or more boxes the email does not go thru. If I have the console open and I look at the string for the name space recipients, when it works you see the list as:
'firstname.lastname@example.org’,‘email@example.com’ and so on.
When it does not function and you look at the same string you see:
'firstname.lastname@example.org’,’’,‘email@example.com’ and so on. I am not sure how to remove that blank set of quotes.
[code]Here is the code i am using:
name1 = event.source.parent.getComponent(‘Container’).getComponent(‘CheckBox’).name1
name2 = event.source.parent.getComponent(‘Container’).getComponent(‘CheckBox 1’).name1
fulllist = name1,name2
body = partid + " - " + partdesc
recipients = [fulllist]
I did try using the + symbol between the name and ended up with a mix of single and double quotes such as:
“firstname.lastname@example.org’,'email@example.com” and so on. the double quotes was mixed in.
Is it because the checkboxes are null when not selected but contain the email string when they are selected as to these single quotes that cause it not to email? What would be the best solution here?
Thanks and have a great weekend