Willkommen, Gast
Angemeldet bleiben:

THEMA:

How? Additional text to MailBack Email (custom) when checkbox is checked. 4 Jahre 4 Monate her #225389

  • Autor
  • Beachi
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Beiträge: 25
  • Dank erhalten: 0
Hi,

how can I add additional infos to Mailback Email (custom) when a single checkbox is checked?
The addional infos will be instructions and links for the recepient what to do next.

Name of checkbox = Infos
Value of checkbox = Yes, send me more Infos

The element option in Advanced tab of my checkbox "Only send to corresponding mailback field when checked" is checked.

Please help.

Thanks

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

How? Additional text to MailBack Email (custom) when checkbox is checked. 4 Jahre 4 Monate her #225426

  • mihaela
  • Offline
  • Developer
  • Developer
  • Beiträge: 3128
  • Karma: 105
  • Dank erhalten: 416
Hello,

From what I understood, you just want to know how to create custom emails? It is explained here crosstec.org/en/support/online-documenta...mailback-emails.html how to do so.

If you have the "Only send to corresponding mailback field when checked" checkbox checked, then the mailback email will be sent only if that checkbox is checked so there is no need for some special coding to add additional info if checkbox is checked, since otherwise the mailback won't be sent.

Did I understand you correctly?

Regards,

Mihaela

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

How? Additional text to MailBack Email (custom) when checkbox is checked. 4 Jahre 4 Monate her #225433

  • Autor
  • Beachi
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Beiträge: 25
  • Dank erhalten: 0
No you didn't understand correctly.

Let me explain more.
I have set up my form with inputs, radiogroup and 3 single checkboxes.

Depending on what radiobuttonoption is checked the Mailback Email (custom) goes to different email recepients. And also the Admin Email goes to the custom emailadress. That works fine.

The 2 of the single checkboxes are obligatory to be checked (the are for Declaration of consent Contact form and data processing) and for that part there is already some text and Link in Mailback Email (custom). That works fine too.

Now I have the 3. checkbox which is not obligatory (its for a newsletter demand). So when it is not checked than the Mailback Email (custom) gets send as it is to the emailadress the user put in the form. That works fine too.

And now to my question.
If the 3. checkbox gets checked than I need additional infos for the recepient in the Mailback Email (custom) with more instructions.

How can I add additional infos to Mailback Email (custom) when this 3. checkbox is checked?

Diese Nachricht enthält vertrauliche Informationen.

Should I sent you my package.
Maybe you understand better than.

Thank you

Beachi

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

How? Additional text to MailBack Email (custom) when checkbox is checked. 4 Jahre 4 Monate her #225535

  • mihaela
  • Offline
  • Developer
  • Developer
  • Beiträge: 3128
  • Karma: 105
  • Dank erhalten: 416
Hello again,

Thank you for the explanation. I think I understand now what you want to achieve, but you can send me your form to mihaela.kobovac@crosstec.org just in case.

One more question, where do you create the custom Email?

Regards,

Mihaela

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: Post by mihaela.

How? Additional text to MailBack Email (custom) when checkbox is checked. 4 Jahre 4 Monate her #225537

  • Autor
  • Beachi
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Beiträge: 25
  • Dank erhalten: 0
I create the custom Email in Advanced > More options > MailBack Emails.

I'll send you my Package shortly.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

How? Additional text to MailBack Email (custom) when checkbox is checked. 4 Jahre 4 Monate her #225592

  • mihaela
  • Offline
  • Developer
  • Developer
  • Beiträge: 3128
  • Karma: 105
  • Dank erhalten: 416
Hello again,

Thank you for the package. I can't see the custom email that you have made because while creating package that part is removed. Nevertheless, now I understand what you want to achieve so it is not necessary for me to see it.

There isn't a simple option to achieve what you want in Advanced > More options > MailBack Emails.

To do what you want you have to create a mailback email template as explained here crosstec.org/en/support/online-documenta...-templates-work.html . I will explain a bit more how to do it.

I will put here an example of mailback template that you have to name FORMNAME_mailback.html.php and put in /media/breezingforms/mailtpl/ folder.

This is an example for a form that includes textfield "name" and checkbox named "check" . If the field "name" is filled it will print out the name and if the checkbox is checked it will show some additional text.
<?php

//set variables for every element in your form
$nameTitle = '';
$name = '';


$checkTitle = '';
$check = '';


if (count($MAILDATA)){
   foreach ($MAILDATA as $data) {
      $title = wordwrap(htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'), 40, '<br />', true);
      $value = nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8'));
      switch($data[_FF_DATA_NAME]){
          
        case 'name':  //replace name with name of another element, LITTERALLY
          $nameTitle = $title;
          $name = $value;
          break;  //add a case for every element in your form
        case 'check':  
          $checkTitle = $title;
          $check = $value;
          break;

        }
      }
    }
?>

<?php if ($name!= '') { echo $nameTitle.": ". $name;  ?>  <br>  <?php }  ?>

<?php if ($check!= '') { echo "Here is some additional info!";   }  ?>
First, define empty variables for each field of your form that you want to have in the email.
In the IF and FOREACH statement you will take each value from the form and using the SWITCH-CASE statement, each value will be saved in the corresponding variable in the template. Here it is important to put the Names of elements of your form literally into cases.
Finally, if the checkbox is checked add the text that you want.

I hope this will help you. If you have more questions, feel free to ask.

Regards,

Mihaela

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Seite:
  • 1
  • 2
  • 3
Moderatoren: ForumSupport
Ladezeit der Seite: 0.057 Sekunden

Angebot

Sommer Special! Alle Mitgliedschaften zum Sonderpreis!

Prio Support, alle Extensions und alle Templates in einem Paket.

Hier geht's zur Bestellung

Crosstec hilft sparen!

Falls Sie neu bei Crosstec sind aber bereits einen Formulargenerator bei einem anderen Hersteller gekauft haben, dann bekommen sie von uns einen Rabatt von 25% auf unsere 1-Jahres und Pro-Mitgliedschaften

Wie Sie an den Rabatt kommen?

Schreiben Sie uns einfach eine kurze Email mit beigelegten Kaufbeleg (z.B. PayPal Quittung) an sales@crosstec.org.

Wir unterstützen die Joomla Community

Crosstec unterstützt weltweit alle offiziellen Joomla! User Groups und Organisatoren von Joomla! Days die bei Joomla.org registriert sind.

Falls das auf dich zutrifft und du eines unserer Produkte brauchst, schreib uns eine kurze Email an info@crosstec.org und du bekommst eine Flatrate-Mitgliedschaft geschenkt!