TOPIC:

Alternate Email Recipient 7 months 1 week ago #239030

  • tyekynan's Avatar Topic Author
  • tyekynan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 112
  • Karma: 1
  • Thanks: 3
We have been very busy at work, and we are considering adding another person to help answer emails from a specific form that we have.

What I would like to do is alternate the recipient on the form. For example:

Form is submitted and sent to person1@website.com
Form is submitted again and sent to person2@website.com
repeat.

So every form sent is split between 2 email addresses.

If this isn't possible, is there a way to add a 1 or 2 to the subject line and have it alternate for each submission, so I can filter it within gsuite? I am not sure how to handle this problem of wanting the emails to alternate which address the forms are sent to, but I am trying to create a solution.
Thanks, as always.

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

Alternate Email Recipient 7 months 1 week ago #239050

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

Do you want that form is sent to both email addresses?

If that would work for you, in your form Properties in the "Email recipient(s)" field you can enter more email addresses, separated by semicolon.

Would that solution suit you?

Regards,

Mihaela

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

Alternate Email Recipient 7 months 6 days ago #239060

  • tyekynan's Avatar Topic Author
  • tyekynan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 112
  • Karma: 1
  • Thanks: 3
Negative, I need the emails to alternate to the addresses as each email would push a potential client to one employee or the other, not both. I use zapier, I believe if I have a way to put in some sort of ID based on submitted records, I can use a webhook and filter that id. Please advise.

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

Alternate Email Recipient 7 months 6 days ago #239069

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello again,

Ok, I understand now.

What you could do is you could count the number of records and add a field in your form where this count will be displayed. Here it is explained how to do so crosstec.org/en/blog/939-count-number-of-records.html .

Then you might use this count in zapier if you know how.

My idea would be to define your email in the End Submit pieces as follows.

You would have to go to form's Advanced properties > More options > Submit pieces and in the End Submit pieces set Type to Custom.
In the code area below you would put a code like this:
$this->execPieceByName('ff_InitLib');

// get the ID of that last record
$db = JFactory::getDBO();
// replace MyFormName with the name of your form
$db->setQuery('Select Id From #__facileforms_records Where name="MyFormName" BY id DESC');
$id = $db->loadResult();

// Define email
$from = 'test@test.com';
$fromname =  'yourname';
$subject = 'mysubject';

// Here you define the body of email
$body = '';
foreach ($this->maildata as $data) {
   $body .= $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
}


// send mail to a different recipient based on whether the id is odd or even number
$recipient1 = 'person1@website.com'; 
$recipient2 = 'person2@website.com'; 

if($id % 2 == 1) {
    $this->sendMail($from, $fromname, $recipient1, $subject, $body);
}
else if($id % 2 == 0) {
    $this->sendMail($from, $fromname, $recipient2, $subject, $body);
}

This will make it work in a way that records with odd ID will go to 'person1@website.com' and records with even number to 'person2@website.com'.

The thing is, that if you wish to use a Custom email template it will be a bit more demanding since you would have to write custom code.

Let me know whether this works as you wanted.

Regards,

Mihaela

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

Alternate Email Recipient 6 months 3 weeks ago #239278

  • tyekynan's Avatar Topic Author
  • tyekynan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 112
  • Karma: 1
  • Thanks: 3
Im not great at code, but I suspect that this only works if I am using email notification?

My original thought was:

FIll out form>
catch webhook with zapier>
filter with zapier
If ID ends in 1,3,5,7,9 send to email 1 via gmail
If ID ends in 0,2,4,6,8 send to email 2 via gmail

Is there anyway to input the record id into a hidden field on submit?

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

Alternate Email Recipient 6 months 2 weeks ago #239385

  • tyekynan's Avatar Topic Author
  • tyekynan
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 112
  • Karma: 1
  • Thanks: 3
Anything?

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

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.049 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

Summer Sale!

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!