Problem using 2 values

  • ViniciusCM
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 0

ViniciusCM created the topic: Problem using 2 values

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...
#130229
  • Posts: 4667
  • Karma: 72
  • Thank you received: 411

lennerd replied the topic: Problem using 2 values

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
===============================================
#130312
  • Posts: 15270
  • Karma: 287
  • Thank you received: 1074

pedro81 replied the topic: Problem using 2 values

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); 
}

Regards,
Pedro
=========================================Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
==============================================
#130314
  • Posts: 12
  • Thank you received: 0

LaurieM replied the topic: Problem using 2 values

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.
#236750
Moderators: ForumSupporttomeperica
Time to create page: 0.072 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

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

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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 to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here