Jump to content

action hook that sends email to remote address


mysmallbizu

Recommended Posts

I'd like an action hook that sends a specifically formated email to my autoresponder created when a client completes an order... but not on a recurring payment.

 

The email should look like:

 

The “remote control” email must be sent to remote@yourdomain.com (insert your own domain in the place of yourdomain.com) and it must have a subject line in the format shown below. Unknown entries can be omitted.

 

owner=p1+password=p2+action=p3+name=p4+email=p5+autoresponder=p6+p7+TRAp8+ip=p9+drop=p10

 

The parameters p1 to p10 are explained here

 

p1: Your owner name : Required

 

p2: Your password : Required

 

p3: subscribe or unsubscribe

 

p4: Your subscriber's name

 

p5: Your subscribers email address

 

p6: Your autoresponder's subscription address (without the domain)

 

p7: plain or html

 

p8: The tracking tag to be associated with the subscription

 

p9: The IP address to be associated with the subscriber's record.

 

p10: Set to yes if you want the drop rules for the autoresponder to be actioned by this subscription.

 

For example, the following subject line would be valid:

 

owner=abc+password=12345+action=subscribe+name=John+email=john@johndoe.com+autoresponder=info+ip=10.10.0.3

 

I thought there was checkout script that did this before action hooks but I haven't seen anything similar for action hooks...

 

Any suggestions or can someone get me started here???

 

Thanks...

Link to comment
Share on other sites

I took this bit of code from the old checkout script and tried to modify if for actionhooks...

 

So far this is what I've added to the actionhooks.php but it stalls when run.... Can anyone point me in the right direction to get this working?

 

 

function actionhook_ClientSignup($vars) {

$sendEmail = "my name <name@emailaddress.com>";

$emailto = "name@anotheremailaddress.com";

$subject = "owner=owser+password=password+action=subscribe+name=$vars["FirstName"] $vars["LastName"]+email=$vars["Email"]+autoresponder=autorespondername+p7+p8+p9+p10

$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text; charset=iso-8859-1' . "\r\n";

$headers .= "From: $sendEmail" . "\r\n";

$headers .= "Content-type: text/plain; charset=iso-8859-1" . "\r\n";

$datetimefull = date("l F dS, Y - h:i A");

$message = "

";

mail($emailto, $subject, $message, $headers);

 

# This function runs when a new client is added

# $vars["ClientID"]

# $vars["FirstName"]

# $vars["LastName"]

# $vars["CompanyName"]

# $vars["Email"]

# $vars["Address1"]

# $vars["Address2"]

# $vars["City"]

# $vars["State"]

# $vars["Postcode"]

# $vars["Country"]

# $vars["PhoneNumber"]

# $vars["Password"]

}

 

If someone could help me with this I'd greatly appreciate it..

Link to comment
Share on other sites

This line is invalid php syntax:

 

$subject = "owner=owser+password=password+action=subscribe+na me=$vars["FirstName"] $vars["LastName"]+email=$vars["Email"]+autoresponder=autorespondername+p7+p8+p9+p10

 

You need to learn how to include variables inside quotation marks:

 

http://us2.php.net/manual/en/language.types.string.php

 

Look for 'Variable parsing', specifically 'Complex (curly) syntax'.

Link to comment
Share on other sites

  • 6 months later...

I don't want to learn php :-) I just want the hook working!

 

I purchased the email marketing module that arcdigital was offering... but It isnt' working with 4.0 and I dont' think they are going to release any fixes for it.

 

Bottom line is that I need to get this working - just a specifically formated email sent out when a new user registers or a new order is placed...

 

If anyone could take a quick look at the above posts I'd greatly appreciate it..

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 2 months later...
  • 2 months later...
  • 1 year later...
  • 7 months later...

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated