I like to use a ping to sent an invoice after a membership

Hi,

I like to use a ping to sent an invoice after a membership purchase (i can't believe this isnt integrated yet), however using the following example mail function:

<?php
$to = 'myemail@gmail.com';
$subject = $_POST['username'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$message = "Blog url: ".$_POST['blogurl']."
Username: ".$_POST['username']."
Subscription: ".$_POST['subscription']."
Membership Level: ".$_POST['level']."
" ;
mail($to, $subject, $message, $headers);
?>

and the following ping setup:

Ping name: Receipt
Ping URL: http://mysubdomain.mydomain.nl/pingtest.php
Pingdata:
blogurl=%blogurl%
username=%username%
subscription=%subscriptionname%
level=%levelname%

Ping-method: POST

It does sent the e-mail but it does not post the values such as username and subscription. Please tell me what i'm doing wrong.

Thanks

  • Alexander

    Hi @Daniel,

    It might be easier to do this using membership communications. You can setup a message to go out the day a payment is made. You have similar tags to work with, and can type it up and make changes from your dashboard.

    I'd advise checking into that. If you still want to use the ping, can you advise that you're working with the latest version of the plugin?

    You might also want to try logging the full contents of the POST global to see what's going on.

    ob_start();
    echo "<pre>";
    var_dump($_POST);
    echo "</pre>";
    $post_data = ob_get_clean();

    Hope this helps!

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.