CalcBuilder Forum

Get email address from "Show send by email?"

Usuario satatwork 2017-12-05 01:26:30

I want to change the Subject line to include the primary recipients email...i.e. the one entered via "Show send by email" mechanism.

For example...I'd like create a variable called SENDTO that has the email address in it so I can then manipulate the subject line like this
$subject=$subject." for ".SENDTO." - ".$dateandtime;

I tried SENDTO = $email.... and it works for the email sent to the recipient BUT for BCC recipients it doesn't and instead inserts the word ARRAY.

And even for the BCC recipients I want the subject to still have the email entered in the "Show send by email" field.

Thanks

Moonsoft support 2017-12-05 10:01:36

Hi,
when users click the 'send by email' option, the email filled is sent using 'email' variable. But this is an internal parameter, not one of your calculator fields, so in order to recover it at the calculator code you need to use standard joomla functions to get variables from the request:

$jinput = JFactory::getApplication()->input;

$emailentered = $jinput->get('email');


Here the official reference:

https://docs.joomla.org/Retrieving_request_data_using_JInput



Regarding bcc data, this is a list of emails, so you need to recover each one inside the array if you want to concatenate to build a text. There is a php function which does exactly this:

http://php.net/manual/en/function.implode.php


Hope this helps, regards

...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!
...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!