Form Help

TOPIC:

Manually trigger mailback emails in submit pieces? 1 year 7 months ago #264710

  • Topic Author
  • jdwires
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 54
  • Thanks: 2
I'm trying to make my form that has an AJAX save progress button only send the mailback emails when the submit button is clicked. I was planning to turn off the mailback email form properties and to used a hidden "finished" field to hold a boolean value set by the save progress and submit buttons. Then, in the submit pieces, send the admin and mailback emails if the finished value was "true". What functions do I need to call in the end submit to trigger the admin and user mailback emails?

Thanks in advance,
Joel

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

Manually trigger mailback emails in submit pieces? 1 year 7 months ago #264715

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Registered
  • Posts: 12079
  • Thanks: 786
Hi,

basically in the end submit pieces you can use custom php mail to receive admin and mailback email (when mail notification and mailback is turn off).

Based on selection user can receive mail.

If someone click on submit button, that hidden field is set to finished and mail should be send, am I right? Sorry, if I missed something

Regards,
Tihana

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

Manually trigger mailback emails in submit pieces? 1 year 7 months ago #264739

  • Topic Author
  • jdwires
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 54
  • Thanks: 2
I think you understand it correctly. Progress button clicked= form submitted with NO emails sent. Submit button clicked = from submitted AND emails sent.

This is what I had in mind so far for the endsubmit:
$this->execPieceByName('ff_InitLib');

$finished = ff_getSubmit('finished');

if($finished == 'true'){
    // do amazing PHP stuff here.
    //send admin email
    //send email to email address from form field
    // possibly use the custom mailback templates??
}

Is there a way to use the specified custom mailback and admin emails in the end submit or can I not use them if the mail notifications are turned off?

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

Manually trigger mailback emails in submit pieces? 1 year 7 months ago #264740

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Registered
  • Posts: 12079
  • Thanks: 786
Hi,

ok, then this finished element should have a value true then you can use this part:
if($finished == 'true')
This means when you defined element finished in Properties you can set value true for that.

Then in end submit pieces you can use this code:
$this->execPieceByName('ff_InitLib');
$from = 'tihana.krivic@crosstec.org'; // Change this to the EMAIL ADDRESS you want to appear in the Email's FROM field
$fromname = 'Tihana Krivic'; // Change this to the 'FROM' NAME you want to appear in the Email
$recipient = ff_getSubmit('email'); //change email with name of your email element (not title), this is for mailback
$subject = 'Your Subject Here';
$finished = ff_getSubmit('finished');


$body = '';
foreach ($this->maildata as $data) {
  $body .= $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n"; 
}



if($finished==true) {
$this->sendMail($from, $fromname,$recipient, $subject,$body);
$this->sendMail($from, $fromname,'tihana.krivic@crosstec.org', $subject, $body);
}
Please replace my email with your admin email

Regards,
Tihana

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

Manually trigger mailback emails in submit pieces? 1 year 7 months ago #264741

  • Topic Author
  • jdwires
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 54
  • Thanks: 2
Sweet. I'll give it a try. Thanks!

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

Manually trigger mailback emails in submit pieces? 1 year 7 months ago #264742

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Registered
  • Posts: 12079
  • Thanks: 786

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.058 seconds

Support Chat

Join our Discord chat and enter the Crosstec channels for live-support, chat forums and interact directly with the community!

After joining, please enter the Crosstec Area and use the #crosstec-support or #crosstec-general channels.

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

Subscribe to news and updates!

Special Offer

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!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!