Forums

Problem with Email GH, sending to multiple email addresses fails

hogash 15 Apr, 2014
Hey guys,

I truly admire your work, by far one of the top 5 Joomla extensions!!

I have a contact form with different departments, this is the code setup in custom code:
<?php
$recipient = JRequest::getString('subject', 'technicalquestions', 'post');

$emails = array (
  'technicalquestions' => 'andrew@somewebsite.com',
  'internationalinquiries' => array('peter@somewebsite.com', ' jimmy@somewebsite.com')
);
$form->data['email_to_use'] = $emails[$recipient];


Added settings for the Email GH screenshot here: general - http://screencast.com/t/0r8zNn7gG and email setup http://screencast.com/t/Apj6mYwKUl .

I keep getting "You must provide at least one recipient email address." and this is the debugger's result:

Array
(
    [chronoform] => contact
    [event] => submit
    [format] => html
    [Itemid] => 116
    [option] => com_content
    [view] => article
    [id] => 8
    [email] => andrew@somewebsite.com
    [first] => marius
    [last] => andrew
    [address1] => test address
    [address2] => 
    [city] => city
    [state_region] => ro
    [postal_code] => 039485
    [country] => country
    [subject] => internationalinquiries
    [comments] => oidfjgsdiofhj
    [chrono_verification] => kdnvi
    [input_submit_15] => Submit
    [4d161768732ac58dd995469402ef5d65] => 1
    [email_to_use] => peter@somewebsite.com, jimmy@somewebsite.com
    [usrsubj] => International Inquiries Form Submission
    [subjecttype] => International Inquiries
    [usrname] => marius andrew
    [created] => 2014-04-16 12:36:17
    [modified] => 2014-04-16 12:36:17
    [datetime] => 2014-04-16 12:36:17
    [chronoform_data] => Array
        (
            [cf_uid] => 3f7bb329b0a1a754c032cc37503f2e74
            [cf_created] => 2014-04-16 00:36:17
            [cf_created_by] => 0
            [cf_ipaddress] => 84.232.217.61
            [cf_user_id] => 0
            [chronoform] => contact
            [event] => submit
            [format] => html
            [Itemid] => 116
            [option] => com_content
            [view] => article
            [id] => 8
            [email] => andrew@somewebsite.com
            [first] => marius
            [last] => andrew
            [address1] => test address
            [address2] => 
            [city] => city
            [state_region] => ro
            [postal_code] => 039485
            [country] => country
            [subject] => internationalinquiries
            [comments] => oidfjgsdiofhj
            [chrono_verification] => kdnvi
            [input_submit_15] => Submit
            [4d161768732ac58dd995469402ef5d65] => 1
            [email_to_use] => peter@somewebsite.com, jimmy@somewebsite.com
            [usrsubj] => International Inquiries Form Submission
            [subjecttype] => International Inquiries
            [usrname] => marius andrew
            [created] => 2014-04-16 12:36:17
            [modified] => 2014-04-16 12:36:17
            [datetime] => 2014-04-16 12:36:17
            [contactus_id] => 54
        )
    [chronoform_data_contactus_id] => 54
    [IPADDRESS] => 84.232.xxx.xxx
)

No validation eeros, array empty.

I'm really looking forward in your reply as i'm out of ideas. Thank you so much and promise to buy a beer!!!

Best,
Marius
GreyHead 17 Apr, 2014
Hi Marius,

Because the Email [GH] action lets you mix and match static and dynamic values in the Email boxes you have to use curly brackets to show which are dynamic. Please try {email_to_use}.

From the Help tab:
The Dynamic and Static tabs have been merged into an Email Setup tab.
The boxes on the Email Setup tab will accept either a string e.g. user@example.com or an input name in curly brackets {input_text_1}. This lets you mix and match static and dynamic values.


Bob
hogash 17 Apr, 2014
Thank you so much Bob, if only i'd open that documentation and actually read the instructions, doink . A coffee for you sir!

Best,
Marius
This topic is locked and no more replies can be posted.