Jump to content

[RESOLVED] - Addition to email sent for virtual download.


DOSPLUS

Recommended Posts

Hi,

The aim is simple, trigger a URL when the virtual product download email is sent to the customer.
One triggered URL per product bought (virtual only.)

Once the email is triggered, I need a loop that will take each product info :

1 - reference # (From back end ref number field), and; (number one is used as exemple)
2 - member account email adress

For example, the script sending the download email (OrderHistory.php, i think) already contains these variables.
But i need to post a URL to a specific adress INVISIBLY in order to trigger another script.

Manually i would trigger the email like this in the browser adress bar:

http://www.mydomain.com/a_folder/process.php?item=1&[email protected]

Above URL triggers an email sent to mentionned email and containing instruction about product 1.

So, i want to use ;

$product_reference_number = 1 ;
$curstomer_email = [[email protected]] ;

And loop it to trigger an email for every product bought (Virtual only)
So when the loop executes, i would have the URL posted.


loop1 /// http://www.mydomain.com/folded/process.php?item=1&[email protected]
loop 2 /// http://www.mydomain.com/folded/process.php?item=2&[email protected]

Basically, these URL trigger another script!
I need this asap...

Any takers!

Link to comment
Share on other sites

  • 2 weeks later...

I don't see how because it doesn't create a new email or run any link.
It is going to be a little more complicated than that, I'm afraid.

Take it from me. I am doing dynamically generated reports and only do them when I get the correct response
from the payment processor.

If you need more info, let me know.

Link to comment
Share on other sites

The script added is:

                                                                               // Start 
                   $su_query = "select reference from ps_product where id_product  = ". $virtualProduct['product_id'];
                   $su_result  = mysql_query($su_query);
                   $su_res = mysql_fetch_object($su_result);
                   $su_reference = $su_res->reference;        
                   $su_email = $result['email'];
                   $URL="www.mydomain.com/my_script_folder/processfile.php";
                   $URL_tail = "?item=".$su_reference."&mail;=".$su_email ; 
                   $su_url = "http://". $URL. $URL_tail;

                                                                               echo $su_url;                    
                   //$test = file($su_url);
                   //print_r($test);
                                                                   // End    

Link to comment
Share on other sites

To be more in line with PS code, why not change these lines:

$su_query = "select reference from ps_product where id_product  = ". $virtualProduct['product_id'];
$su_result  = mysql_query($su_query);
$su_res = mysql_fetch_object($su_result);
$su_reference = $su_res->reference;   


to this:

$su_query = 'SELECT reference FROM `'._DB_PREFIX_.'product` WHERE `id_product`='.$virtualProduct['product_id'];
$su_reference = Db::getInstance()->getValue($su_query);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...