TOPIC:

Admin EMails - Tokens are not replaced in 'Alternative Reply-To Email' and .. 1 year 8 months ago #231097

  • Topic Author
  • OPape
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Hi,

I build a contact form and try to use the entered email address and name for the fields
'Alternative Reply-To Email' and 'Alternative From Name' to make it easier to reply direct to the incoming contact message.

Example:

Alternative Reply-To Email = {contact_email:value}
Alternative From Name = {contact_name:value}

In both fields the tokens not replaced but it works perfect in field 'Custom Email Subject'. Here all tokens replaced as expected.

Is this a bug, a feature, or am I doing something wrong?

Otherwise, BreezingForms is a great product and I have been able to experience all the tasks with it so far.

Thanks and regards,

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

Admin EMails - Tokens are not replaced in 'Alternative Reply-To Email' and .. 1 year 8 months ago #231101

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Hey,

If you want to pass values from your form to your let's say "Custom Email Subject" you simply need add the name of the element you want to pass value from and wrap it in curly brackets like so : {email}.

Hope this clarifies the situation.

Regards,
Mario

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

Admin EMails - Tokens are not replaced in 'Alternative Reply-To Email' and .. 1 year 8 months ago #231104

  • Topic Author
  • OPape
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Hi Mario,

yes in the "Custom Email Subject" it works:
Custom Email Subject = "New message from: {firstname} {lastname} <{email}>"
... produces a subject like this:
"New message from: Peter Miller <p.miller@domain.com>"

But if this tokens used in "Alternative Reply-To Email" and "Alternative From Name" you got emails with a sender address like this:
{firstname} {lastname} <mailer-daemon@mydomain.com>

In these fields replacement does not work.

Regards,
Olaf

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

Admin EMails - Tokens are not replaced in 'Alternative Reply-To Email' and .. 1 year 8 months ago #231114

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Olaf,

Alternative Reply-To Email and Alternative From Name can accept only 1 parameter, for example you cannot put {email}{lastname} but ONLY {email} OR {lastname}.
But there is a workaround for this too...

What you have to do is create a hidden field in your form where it's value should be :
ff_getElementByName('hidden_element').value = ff_getElementByName('name').value + " " + ff_getElementByName('lastname').value;

Latter on you can add {hidden_element} to your Alternative From Name.

Hope this helps.

Regards,
Mario

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

Last edit: Post by MarioPuco.

Admin EMails - Tokens are not replaced in 'Alternative Reply-To Email' and .. 1 year 8 months ago #231133

  • Topic Author
  • OPape
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Thanks Mario,

but I'm really new with BreezingForms.

1. I put your code modiefied with my fieldanmes
ff_getElementByName('contact_hidden_name').value = ff_getElementByName('contact_firstname').value + " " + ff_getElementByName('contact_lastname').value;
in the Value field of contact_hidden_name.
notOK - contact_hidden_field contains exact this string.

2. I put your code modiefied with my fieldanmes and <?php
<?php ff_getElementByName('contact_hidden_name').value = ff_getElementByName('contact_firstname').value + " " + ff_getElementByName('contact_lastname').value; ?>
in the Value field of contact_hidden_name.
notOK - I got an Parse error ... in line1.

3. I tried it in "Submit pieces"->Before Submit->Type "Custom" with
ff_getElementByName('contact_hidden_name').value = ff_getElementByName('contact_firstname').value + " " + ff_getElementByName('contact_lastname').value;
notOK - contact_hidden_name is always empty

What I'm doing wrong?

Thanks and regards,
Olaf

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

Last edit: Post by OPape.

Admin EMails - Tokens are not replaced in 'Alternative Reply-To Email' and .. 1 year 8 months ago #231194

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Olaf,

No worries, I can see that you are familiar with coding, but tiny tweaks are required since you are combining PHP with some JS and it won't work :D

You will need to add this code to Form Advanced Options > More options > Scripts > Initialization Script > Custom > Press "Create Code Framework" and add this inside the function :
setInterval('ff_getElementByName("contact_hidden_name").value =  ff_getElementByName("contact_firstname").value + " " +  ff_getElementByName("contact_lastname").value;',500);

Let me know if this worked for you.

Regards,
Mario

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

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

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

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!