TOPIC:

Problem using 2 values 5 years 8 months ago #130229

  • Topic Author
  • ViniciusCM
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Thanks: 0
I'm having problem trying to use 2 values in Select From List... I need to use 2 e-mails for each option selected..

Example:
1;<<Select a Option>>;
0;Normal;vinicius.moura@example.com; (That works, of course)
0;Test1;vinicius.moura@example.gov.br,example_moura@example.com (Thats what I need) Example1
0;Test2;vinicius.moura@example.gov.br|example_moura@example.com (Thats what I need) Example2

But how I can make this works? I have no ideia how to put 2 values together...

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

Problem using 2 values 5 years 8 months ago #130312

  • lennerd
  • Offline
  • Developer
  • Developer
  • Posts: 4669
  • Karma: 72
  • Thanks: 411
Hello,

id your question about storing those twq email addresses or about sending emails to those adresses?

If you want to send an email to both you will need to do this in another way.

In this case you will need to create custom emails with PHP. Please see the following link how this can be done:

crosstec.org/support/index.php?pid=knowl...viewentclient&id=133
Regards,
Stefan

===============================================
Satisfied? Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

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

Problem using 2 values 5 years 8 months ago #130314

  • pedro81's Avatar
  • pedro81
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 15273
  • Karma: 287
  • Thanks: 1075
Hi,

A solution could be creating a custom En Submit Script:
Form > Advanced > More options > SUBMIT PIECES > custom END SUBMIT.

But first of all you should change your select list. For this example the select list name will be 'mylist':
1;<<Select a Option>>;
0;Normal;a
0;Test1;b
0;Test2;c

Now, in that End Submit, enter a code like this:
$this->execPieceByName('ff_InitLib');
$from = 'FROM@email.com'; // Change this to the EMAIL ADDRESS you want to appear in the Email's FROM field
$fromname = 'Your Company Name'; // Change this to the 'FROM' NAME you want to appear in the Email
$recipient = ff_getSubmit('mylist'); // HERE IT WILL BE TAKE THE SELECT LIST VALUE (a,b,c)
$subject = 'Your Subject Here';
$body = '';

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

if ($recipient = "a") {
$this->sendMail($from, $fromname, "vinicius.moura@example.com", $subject, $body); 
}

if ($recipient = "b") {
$this->sendMail($from, $fromname, "vinicius.moura@example.gov.br", $subject, $body); 
$this->sendMail($from, $fromname, "example_moura@example.com", $subject, $body); 
}

if ($recipient = "c") {
$this->sendMail($from, $fromname, "vinicius.moura@example.gov.br", $subject, $body); 
$this->sendMail($from, $fromname, "example_moura@example.com", $subject, $body); 
}

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

Problem using 2 values 1 year 3 weeks ago #236750

  • LaurieM
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
Hi there!

I can't get this code to work. Am I missing something here?

1. The $from and $fromname do nothing in the mailback emails.

2. The mailback emails go to all the listed email addresses in $recipient, not just the email selected.

As I examine the code given above, it should do exactly what I need. I see it's a fairly old post. Does this code work in the latest version of Joomla, latest version of BreezingForms and PHP7.2?

If it does work I'll need to study further to get it working.

However, I've successfully used following the code in the value field of a hidden input type to get the record ID in the subject line and in the body of the email.
<?php $db = JFactory::getDBO(); $db->setQuery("SELECT count(*) FROM #__facileforms_records where form=37"); return $db->loadResult() + 1; ?>

If this code could be edited for another purpose, to get the label of a given select list from the database this would be the next best thing.

If I don't use the code given above in form>advanced>more options>Submit pieces>End Submit (which doesn't work for me), I can send the mailback to the selected department by adding the email address as the label and it reports the email address in the email body. That's fine. But I also need to add the department name which is the Label in the select list.

So, as above, is it possible to use different PHP code to do this?

Thanks,
Laurie.

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

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

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!