Dynamic email settings

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
marisoft
User
Posts: 209

Dynamic email settings

Post by marisoft »

Hi,

When exporting to email I would like to dynamically change the email from and to addresses and the message subject and message body.

I presume I have to use Server Events > Table specific > Common > Email_Sending event to do this but any hints on how to this is most welcome.

Best regards,
/Poul


danielc
User
Posts: 1601

Post by danielc »

marisoft wrote:
dynamically change the email from and to addresses and the message subject and message
body

Could you provide example what you want to achieve? If export to email, you need to fill out the form first before send.

In general, in Email_Sending event, change the properties of the $Email object, during development you can use var_dump($Email);die() to view the properties first, then write your code to change them. See the example in help file.


marisoft
User
Posts: 209

Post by marisoft »

Hi danielc,

I would to avoid filling out the form.
The recipients email is in the record I want to export, so I would like to prefill the form, and then show it to the user to complete before sending.

/Poul


marisoft
User
Posts: 209

Post by marisoft »

SOLUTION:

In the Client script > Table specific > View page > Startup script
I have:
$(function() {

jQuery("#ewEmailForm input[name=subject]").val("Brugerregistrering")
jQuery("#ewEmailForm input[name=sender]").val("admin@sdomaine.org")

$toemail = $("#el_mols_brugere__email").text();
jQuery("#ewEmailForm input[name=recipient]").val($toemail )
})

Modify this to your situation:
#el_mols_brugere__email

Cheers,
/Poul


Post Reply