Skip Navigation

[Resolved] Passing an email from one form entry to another.

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by valentinD 5 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1360407
screenshot_79 copy.png

Hi,

I want to create an email form that will allow others to send and email to someone who has created a new custom post on our site.

This is the scenario:

A real estate site.

Someone posts their property and provides a contact email.

Someone else sees this listing and sends them an email - via a contact form.
In other words - passing an email from one form entry to another so that it becomes the “to” in the second form.
The screenshot represent a modal that pops up on a button click when someone wants to mail the poster of the property.
The mail that this modal form will send will be that of the property poster.

How do I archive this? 🙂

Thank you !

#1360535

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Valentine,

Thank you for getting in touch.

This is possible to achieve. To get this correct, the contact form will be on the listing for the page correct ?

If so then I can guide you through this one.

Thanks,
Shane

#1360597
screenshot_80 copy.png

Hi Shane and thank you for your prompt reply.

Yes, the contact form will be in a bootstap modal that will be triggered by an onClick (button) on the actual page of the listing.

#1360613

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Valentin,

We can walk through this in some simple steps, however we first need to ensure that the Listing creator is adding their email to the listing even if it is not displaying publicly.

There must be an email to the listing poster.

The second step is to create a Post Type to hold the messages, you can call it Messages or Contact Mail.

On this you will need to add just an email field so the user can enter their email. The Name field can be the Post Title and the content area can be the default wordpress content area, unless you dont want to allow the user to have any formatting control. In this case you can just create a custom field where the user can type the message.

Also create a field called "Email To" this will hold the email of the person being contacted from the listing.

Once you have done this please let me know and we can move to building the form.

Thanks,
Shane

#1360969

Hi Shane,

Just to clarify - this needs to be a new Custom Post Type that will take the email from this listing form hidden link (ie. the property poster) and "add" it as a "Email To" ?

Thanks.

#1361383

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Valentin,

That is correct.

How our forms work is that it is tied to a post type. So there would need to be a post type created to store the messages. This will essentially function as a message log for the contact form, while using the notification settings to send the emails.

However for this to send to the correct user the "email to" custom field will need to be populated with the email of the Job listing.

We are able to get this from the page when the message form is added to the job listing.

Please let me know if this clears things up for you.

Thanks,
Shane

#1361927
screenshot_86.png

Hi Shane,

Great, following on from your reply (#1360613), I've created a new post type called 'Stored_contacts' and using Toolset's Custom fields, I created 4 fields: Name, Email, Message and Email to (see screenshot). Is this correct?

If so, what is the next step?

I can provide access to the admin section of the site if this makes it easier.

Thanks!

#1362107

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Valentine,

Yes please provide admin access as it will definitely help to speed up the process.

The private fields have been enabled for your next response.

Thanks,
Shane

#1363009

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

I tried to log into the site with the credentials but they don't seem to be working.

Could you try this on your end and let me know if they work ?

Thanks,
Shane

#1363111

Sorry, I've updated the credentials in the previous post.

#1363569

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Valentine,

Take a look here.
hidden link

I've setup the form for you. All you need to do now is to edit the form how you will like it to be and then add it to the modal.

Also you can setup the notifications how you will like them as well.
hidden link

Please let me know if this helps.

Thanks,
Shane

#1363881

Thank you so much Shane!

Looks great 🙂

Two quick questions

1 - how do I hide the form from showing on the bottom of the page. I'm hesitant to delete it from the bottom of the "Template layout for Rental pages".
2 - how do I hide the "to" email in the modal? I don't want the sender to see the recipient's mail.

Thanks again!

#1363899

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Valentine,

You can remove the form at the bottom, it was just for testing purposes.

Also you can hide the to mail section by doing this.

<div class="form-group" style='display:none;'>
<p>		<label>Email to:</label><br />
[cred_field field='email-to' force_type='field' class='form-control' value="[types field='your-email' output='raw'][/types]" output='bootstrap']</div>

Please let me know if this helps.
Thanks,
Shane

#1364031

The issue is now resolved, thank you!