Moonsoft Software Solutions

Get email address from "Show send by email?"

Started 5 Dec 2017 · 1 reply

  1. satatwork
    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
  2. Moonsoft support
    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

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket