TOPIC:

How to change email address in the "From" field 8 months 3 weeks ago #238211

  • Topic Author
  • ldor
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 9
  • Thanks: 0
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

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

How to change email address in the "From" field 8 months 3 weeks ago #238218

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
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

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

How to change email address in the "From" field 8 months 3 weeks ago #238228

  • Topic Author
  • ldor
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 9
  • Thanks: 0
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).

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

How to change email address in the "From" field 8 months 3 weeks ago #238253

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
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

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

How to change email address in the "From" field 8 months 2 weeks ago #238264

  • Topic Author
  • ldor
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 9
  • Thanks: 0
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

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.210 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!