TOPIC:

How? Additional text to MailBack Email (custom) when checkbox is checked. 3 years 5 months ago #225389

  • Topic Author
  • Beachi
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 25
  • Thanks: 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

Please Log in or Create an account to join the conversation.

How? Additional text to MailBack Email (custom) when checkbox is checked. 3 years 5 months ago #225426

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
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

Please Log in or Create an account to join the conversation.

How? Additional text to MailBack Email (custom) when checkbox is checked. 3 years 5 months ago #225433

  • Topic Author
  • Beachi
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 25
  • Thanks: 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?

This message contains confidential information

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

Thank you

Beachi

Please Log in or Create an account to join the conversation.

How? Additional text to MailBack Email (custom) when checkbox is checked. 3 years 5 months ago #225535

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
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

Please Log in or Create an account to join the conversation.

Last edit: Post by mihaela.

How? Additional text to MailBack Email (custom) when checkbox is checked. 3 years 5 months ago #225537

  • Topic Author
  • Beachi
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 25
  • Thanks: 0
I create the custom Email in Advanced > More options > MailBack Emails.

I'll send you my Package shortly.

Please Log in or Create an account to join the conversation.

How? Additional text to MailBack Email (custom) when checkbox is checked. 3 years 5 months ago #225592

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
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

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.042 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!