How to change email address in the "From" field

  • ldor
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 0

ldor created the topic: How to change email address in the "From" field

Hi,

I've created a Tell a Friend form. Everything is fine, the only thing I could not adjust is the e-mail address that appears in the "From" field of the email that is sent to the friend. I would like the sender's email to appear there instead of the "default email notification address" which I entered in the Breezing Forms configuration.

And a second question. Is there a way to enter several e-mail addresses in the same field ("Friend's email" field) so that the field verification script would recognize them and would not display an error message? I tried to enter several addresses separated by coma or by semicolon but the verification script displays an error message then.

Thank you
#238211
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2738
  • Karma: 93
  • Thank you received: 369

mihaela replied the topic: How to change email address in the "From" field

Hello,

Please take a look at t his piece of documentation crosstec.org/en/support/online-documenta...r-email-address.html which explains how to set wanted email address as the sender.

As for your second question, it is possible to write a verification script that would check whether emails separated by a comma are valid.
Note that, in that case, you won't be able to use that addresses for sending "from" address or sending mailback to that addresses.

You have to go to the Properties of the field where email is entered.
Then in the Validation section check the required checkbox.
Set the Validation to Custom and in the code area below that appears put the following code:
function ff_FIELDNAME_validation(element, message)
{
   str = element.value;
       var check =
    /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   
   if(str.includes(",")) {
    var partsOfStr = str.split(',');
    var len = partsOfStr.length;
    for(var i =0; i<len ; i++) {
      if (!check.test(partsOfStr[i])){
          if (message=='') message = "Please enter valid email address.\n";
          console.log("nije dobro");
          ff_validationFocus(element.name);
          return message;
        }
    }
   }
   
    
      
  if(!str.includes(",")) {
    if (!check.test(str)){
        if (message=='') message = "Please enter valid email address.\n";
        ff_validationFocus(element.name);
        return message;
    } // if
   }

   
   return "";
} // ff_FIELDNAME_validation
NOTE: In the code above replace FIELDNAME with the Name of that field.

Let me know whether you have managed to set this for your form.

Regards,

Mihaela
#238218
  • ldor
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 0

ldor replied the topic: How to change email address in the "From" field

Thank you.
I've tried these solutions but unfortunately they did not work.

As for the first question, I wanted to change line 374 in the file helpers.php but the path specified no longer exists. That code must be located somewhere else now.

As for the custom verification code, I did it the way you suggested but then the form stopped working. I mean, when pressing Submit nothing happens - there is no error message but no success message either and no e-mail is sent (I tried to enter two e-mail addresses separated by a coma, did not try anything else).
#238228
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2738
  • Karma: 93
  • Thank you received: 369

mihaela replied the topic: How to change email address in the "From" field

Hello again,

Which BreezingForms version are you using?

You can send me your helpers.php file so I can take a look at it and do the change needed.

As for the custom verification code, I did some additional testing.

For me the form can be submitted with values like this entered:
"test1@gmail.com" , "test1@test.com,test2@test.com".
On the other hand, if something that is not an email address is entered, it will show an error.

It will not go through if there are some spaces in the filed, for example between the emails. They have to be separated by "," ONLY.

Let me know when you test it as from per my instructions, it works.

Regards,

Mihaela
#238253
  • ldor
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 0

ldor replied the topic: How to change email address in the "From" field

Hi Mihaela,
I am using BreezingForms Free (build 931)

First time I could not find the file helpers.php but now I have found it. In the version I use the line mentioned in the help document is No 500, not 374. I tried to change that line but the mails stopped coming at all. I would like to send you the file but how can I do that? I do not see any link for a private message or to send an attachment.

As for the second question, still I cannot solve it. If I choose a custom validation method and add the script, the form simply stops working - nothing happens when pressing Submit. But actually, that is not so important, so no need to bother about it.

Best regards,
Leo
#238264
Moderators: ForumSupporttomeperica
Time to create page: 0.038 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