TOPIC:

Adminmail Empfänger je Sprache 3 years 9 months ago #219043

  • Topic Author
  • felixtreimer
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Hallo ..
Wie kann ich jeder Sprache einen eigenen Admin-Mail-Empfänger zuweisen ohne das Formular für jede Sprache zu kopieren?
Es ist wichtig, dass jeder Admin nur die Mails seines Kontaktformulares erhält und nicht alle. Somit kann ich nicht die Lösung verwenden, einfach alle mit Komma zu separieren.

Vielleicht gibt es ja eine Möglichkeit, die Sprache abzufragen .. $lang = JFactory::getLanguage();
viele Grüße

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

Adminmail Empfänger je Sprache 3 years 9 months ago #219097

  • marko.bosnjak
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2222
  • Karma: 44
  • Thanks: 279
Hello,

could you translate your question to English, please? We are currently little short on German speaking supporters.

Regards,
Marko
======================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
======================================
Need to renew Pro Support?
Buy Here!
======================================
Satisfied?
Consider a Membership!
======================================
Follow us on Facebook!

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

Adminmail each Language 3 years 9 months ago #219101

  • Topic Author
  • felixtreimer
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Of course - sorry.

I have a multible language website. Every Country (language) has it's own admin.
Is there a way to set different adminMail recipient for each language without to make a copy of the form?

Its important, that not every admin gets every mail - they should recieve only their own contact inquiry.

I have already a hidden field with the language code, if this is helpful for a solution.

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

Adminmail each Language 3 years 9 months ago #219200

  • marko.bosnjak
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2222
  • Karma: 44
  • Thanks: 279
Hello,

here's a possible solution.
Go to form's properties > Advanced tab > More options > Submit Pieces > End Submit > Type > Custom and paste this code in the framework:
$this->execPieceByName('ff_InitLib');
$lang = JFactory::getLanguage();
$lang_tag = $lang->getTag();
$from = 'Email@OfYourSite.com'; //Change to the sites Email address
$fromname = 'YourSitesName'; //Change to your Sites name
$subject = 'Your Email Subject'; // Change to your preferred Email subject

//Create your own body for each possible option
$body1 = 'English Version';

$body2 = 'German Version';

$body3 = 'French Version';

//Add form values to the custom email content
foreach ($this->maildata as $data) {
   $body1 .= "\r\n" . $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
   $body2 .= "\r\n" . $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
   $body3 .= "\r\n" . $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
}

if ($lang_tag == 'en-GB') {
$recipient = 'email1@domain.com';
$this->sendMail($from, $fromname, $recipient, $subject, $body1, $mode=1, $attachment);
}
if ($lang_tag == 'de-DE') {
$recipient = 'email2@domain.com';
$this->sendMail($from, $fromname, $recipient, $subject, $body2, $mode=1, $attachment);
}
if ($lang_tag == 'fr-FR') {
$recipient = 'email3@domain.com';
$this->sendMail($from, $fromname, $recipient, $subject, $body3, $mode=1, $attachment);
}
This script is based on 3 languages English, German and French. It will pick the language tag and based on it will create an email and send it to the corresponding address. What you need to do is to insert 3 recipients (instead of email1@domain.com, email2@domain.com and email3@domain.com) and create bodies on 3 languages.

Try it out and let me know if it's working for you.

Regards,
Marko
======================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
======================================
Need to renew Pro Support?
Buy Here!
======================================
Satisfied?
Consider a Membership!
======================================
Follow us on Facebook!

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

Adminmail each Language 3 years 9 months ago #219241

  • Topic Author
  • felixtreimer
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Hey Marko,
thank you. It works perfectly.
Took a bit time, until i was able to build an individual body without an array, but at least i made it!

Last question:
How could i get a second recipient for a country?

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

Adminmail each Language 3 years 9 months ago #219288

  • marko.bosnjak
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2222
  • Karma: 44
  • Thanks: 279
Hello,

that's great. Good job! :woohoo:

If you want multiple recipients, you can add them all in the $recipient variable separated by a comma, like this:
$recipient = 'email1@domain.com, email2@domain.com, email3@domain.com';
Let me know if you run into any trouble.

Regards,
Marko
======================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
======================================
Need to renew Pro Support?
Buy Here!
======================================
Satisfied?
Consider a Membership!
======================================
Follow us on Facebook!

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

Last edit: Post by marko.bosnjak.
  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.078 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!