Send mail can refer to a field for subject and body. Copy your standard message to a text field and allow your user to edit it. A button next to that field can use send mail to send the message.
thanks philmodjunk. need to think that over. to be continued.
To put it another way, I assume the way you have been doing it is setting the standard text as the body of the message, and then tweaking it in your mail client and then sending.
With SMTP you have to do your tweaking inside FM, before sending. What Phil is suggesting is a method of doing that—set up a text field for the body of the message; split your script in two: the first part will post your standard text into this new field and open it on a layout where the user can tweak the text as needed; then click a button which activates the second part of your script to send the message.
Thanks for your comment Keywords.
This is what I plan to set up plus a question.
1. I have a customer info table and a standard messages table. Both are unrelated. A relationship will only be established later (customer X will recieve TWEAKED message Y).
2. From the customer info form user opens drop down list and chooses message to be sent.
3. A SEND_MESSAGE form opens which shows some customer info (untweaked) and the standard message (to be tweaked by user).
4. After tweaking user presses SEND button.
Q: I need to store the standard text in a memvar (otherwise the user changes the standard text when tweaking) before it is displayed. Can't find how you display a memvar on a lay-out? (or needs it to be stored in help field first?)
Thanks for your input!
I would store the standard text in a global field (actually I'd store it in a standard field, which is then used to prep a global field each time the file opens, to make the standard text available via the global). I would also store each outgoing email in its own table—one record per email—with records linked to customer table so you can keep track of what was sent when and to whom.
However you choose to manage your messages, copy the standard message to a text field for editing. You can set a variable to the standard message. Change context and then set a text field to the value of the variable for editing if you choose not to use a global text field. (A global field can be accessed from any layout in your file and thus you don't need a variable in that case. )
BTW, when you set up the message for editing, you can use the substitute function to insert data from your solution into the message text If you put placeholders to mark where to insert that data into the standard message.
keywords and philmodjunk - thanks. i will work on it and make sure it will be of high quality
thanks for the help!
Got it all working exactly as described by keywords and philmodjunk. Thanks guys!
In case you are going to store each message that was send to a customer you might want to do some error trapping to make sure the Send Mail did not return any error. Otherwise you might see records of sent mails that actually never went out of your system.
a very good point. We use a plug in that supports multiple attachments, but our script for sending out queued up emails checks for returned error codes and logs them if returned by the plug-in.
We have, however, found that this is not perfect in our case. We've had emails fail to be sent but with no error code returned. We fixed the issue by sending out email more frequently and in smaller "batches"--and that gives a pretty good indication as to why we weren't finding the emails in the account's "sent" folder, but no error code was being returned to log....
we are not so sophisticated as you guys but this works great:
- note the number of mails to be sent
- after sending check the sent mails number in the mail client/user-id
we also add 3 or more of our own people to every mailing - start, middle and end as a double check and
as a way of measuring our mail is not qualified as spam.