Forums

Multi-Page plugin - send dynamic email

pinochico 12 Oct, 2010
Hello,

I use Multi-Page plugin🙂

In 1. child form with joomla registration plugin I setup two mail (one for admin, one for registration user).

When I submitt this child form, then send mails are OK.

In last child form I need send second mail (2MAIL) for registration user with data from 1. child form (email, jmeno) and another child forms (rating01-rating20).

I use code for transfer information from one child form to another child form and write this code in form HTML in first line and put in hidden fileds (for using mail with dynamic fields):
<?php
$session  =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));

$email = JRequest::getVar('email', '', 'get');
$jmeno = JRequest::getVar('jmeno', '', 'get');

?>


On Submit code - before sending mail a use code for testing - print value fileds email, jmeno:
<?php
Global $mainframe; $mainframe->enqueuemessage('$email:
'.print_r($semail, true));
?>


Question:
When I submitting last child form, Im not recieve 2MAIL with dynamic email...

Where is error?

I buy book about chronoform, but I did not see anything tip about this problem.

Mayby, I need trick with open table com_user and read data from and put into dynamic fields in mail, but i dont know how😟

Thanks for answer.


Rudolf
pinochico 13 Oct, 2010
Nothing idea?


I cannot recieve mail from child form still😟

I trying load data from Joomla table:
<?php
$email = JRequest::getVar('email', '', 'post');

if ( $email ) {
  $db =& JFactory::getDBO();
  $query = "
      SELECT *
          FROM `#__users`
          WHERE `email` = '$email' ;
  ";
  $db->setQuery($query);
  $data = $db->loadObject();

  $to_email = $data->email;
  JRequest::setVar('to_email', $to_email);
}
?>



But nothing heappend still😟
GreyHead 13 Oct, 2010
Hi pinochico,

It's hard to make sense of this without seeing the forms.

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
GreyHead 14 Oct, 2010
Hi pinochico,

I don't actually think that the code to look up the email does anything.

You start with an email, look up the user with that email and then use the email address of the user - which you had to start with.

Why not just add
<input type="hidden" id="to_email" name="to_email" value="<?php echo $posted['email']; ?>" />
in the Form HTML?

I checked with a fixed value in here like this
<input type="hidden" id="to_email" name="to_email" value="bob@example.com" />
(without the OnSubmit Before code) and the email sends OK.

Bob



Bob
pinochico 14 Oct, 2010
Hello Bob,

thanks for correction my code🙂

I trying now Your option ([email]rudolf.balas@seznam.cz[/email] and [email]bob@example.com[/email] too), but email don't recieve still.



There is debug:

Form passed first SPAM check OK
Form passed the submissions limit (if enabled) OK
Form passed the Image verification (if enabled) OK
Form passed the server side validation (if enabled) OK
$_POST Array: Array ( [jmeno] => Rudolf Balas [to_email] => This e-mail address is being protected from spambots. You need JavaScript enabled to view it [hidden_6] => 0 [button_12] => Zařadit do slosování [e978dbad434f968434e6f037eeb9ca09] => 1 [1cf1] => ad47f77b19276dc134f79bf7e03bf574 [chronoformname] => S07_dokonceni )
$_FILES Array: Array ( )
Form passed the plugins step (if enabled) OK
An email has been SENT successfully from (Admin)soutez@soutezzubnichtechniku.cz to This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Debug End




Spambots and Java?

What is this?😟

P.S.
I deleted On Before code from S07 child form and Soutez mother form.

Rudolf
GreyHead 14 Oct, 2010
Hi pinochico,

There's no 'To Email' address in

(Admin)soutez@soutezzubnichtechniku.cz to This e-mail address

Make sure that the name of the hidden input is the same as the name in the Dynamic To box. I think one was email and the other to_email.

Bob
mehulshetty5 17 Oct, 2010
Hi Bob,

As you have seen, I have two chronoforms set up. One is for the people who provide services and the other for people seeking service. Is there a way to send an email to the people seeking service when they register on my site with the contact information of the people who provide services in the area?

Best Regards,

Mehul Shetty
GreyHead 17 Oct, 2010
Hi Mehul,

Yes, you can add PHP to the HTML template (or to the OnSubmit Before Box) to look up the information and build it into a message. If you still have the texts there's an example of this in Chapter 12 of the ChronoForms Book (it was saved to the dataabse there but the methodology is very similar).

Bob
mehulshetty5 25 Oct, 2010
Hi Bob,

I went through the chapter and tried doing different things but it did not work out for me - so I restored it back to the way it was. What I want is that a set of people sign up their business and the area they are comfortable providing services in. Later, when the people seeking service register and provide their post code, automatic emails should be generated to the business sign up people providing the relevant service and in that particular area with the details of the person seeking service. It would be really helpful if you could please have a check and help me out on this. Thank you so much!

Best Regards,

Mehul
This topic is locked and no more replies can be posted.