Third Party Contributions > API Based Plugins
How to send email from JavaScript code, in a plugin
(1/1)
himari_usagi:
Hi,
I have a plugin that must add a disclaimer to a composed email, just before sending.
The email-altering code must use JavaScript, and so is triggered by a 'beforesend' event handler.
The disclaimer is obtained via an async HTTP call, which means:
1. the 'beforesend' handler must return false, to prevent the immediate email send, and give time to the HTTP call to happen;
2. after the disclaimer is obtained and the composed email altered, an email "send" action must be triggered.
My question is how to trigger an email send using JavaScript.
Thanks
JohnDoh:
call the action like this
--- Code: ---rcmail.command('send','')
--- End code ---
or call the send function directly like this:
--- Code: ---rcmail.submit_messageform()
--- End code ---
Navigation
[0] Message Index
Go to full version