Jump to content

Recommended Posts

Hello !

 

I am sure there is more than one smart freak around here that is awesome enough to figure out the solution for my challenge here.

 

So I have a contact form and events on my website that I promote via other people also (affiliates).

People come chose event, put name, email, telefon and promotional CODE (actually affiliate code) aff1, aff2 etc.

At this point the form sends out an email to me for each registration.

How can I make the form send out an email to the affiliate also when a user inserts his affiliate code in the CODE input box ?

So one mail comes to me and automaticly one goes to the affiliate.

 

 

I think at two different solutions - either with database or not.
A. database

In my database I have one colum with affiliate codes and next one with their email address. The form searches for a match in database for code entered and if finds a match it send a copy of form submission to the email address associated with the affiliate code it found.

 

B. using IF

IF input_affcode = 001 then sendmail to aff1@yahoo.com
IF input_affcode = 002 then send mail to aff2@gmail.com

etc.

Now I don't know how to do that in coding :) Please help me out.

For this moment I am using SIMFATIC forms and I would like to have this small function implemented to the code....otherwise it works very well.

 

This is from main code...my thought is to condition the autoresponder to send depending on the code it finds in the input field.

$data_email_sender =  new FM_FormDataSender(sfm_readfile("./templ/contactus_email_subj.txt"),sfm_readfile("./templ/contactus_email_body.txt"),"%email_f%");
$data_email_sender->AddToAddr("office@universulsacru.ro");
$formmailobj->addModule($data_email_sender);

$autoresp =  new FM_AutoResponseSender(sfm_readfile("./templ/LP_inregistrare_resp_subj.txt"),sfm_readfile("./templ/LP_inregistrare_resp_body.txt"));
$autoresp->SetToVariables("numeprenume_f","email_f");
$formmailobj->addModule($autoresp);

 


All the best to you!
Andrei Stefan

 

Link to comment
https://forums.phpfreaks.com/topic/276374-help-for-contact-form-improvement/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.