Go to the related records and then loop through the records. The message body can be stored in a variable.
Hi Mr Vodka
Thank you for your reply, How I wanted to ask you what you meant! but instead I gave it a go to try and make the script and I have got it working! (well sort of) It pays to try as you can learn more.
Ok, I have got the script working as follows:
I am in my Email layout that I want send out and on this layout is the subject and body text I want,
I have a button to run the script. This opens up my contact layout and selects the related contacts.
I have created variables for the send email, so that the contact is inserted in the to field, and the subject field and body field are also done by variables.
Then it loops, finishes and closes the window
this works well and an email is created for each contact, I have got the personalised first name working as well in the body of the email.
The problem is, I then create a new email layout record with new subject and body text and when I press the send button it sends to the right contacts that are related to this new record, but it doesn't update the subject and body text to the new text? These stay as the first record I created?
Hi Mr. Vodka
It's OK I sorted it. I had the "set variables" for the email subject and body in the wrong place on the script, they needed to be at the top before the loop.
Thanks for your pointer, I always try to solve any issue before I ask on the forum as I don't like annoying people too much and I prefer to find out with trial and error, but sometimes I can stare at the screen completely blanked out!!! With this little glitch I have been working on and off for over 4 days, but I have learnt so much in the process about this and other things as well.
Thanks for you help!
No problem. Its great that you gave it effort to try and figure it out. That is the best way to learn. :-)