latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Create Email Representative of Placed Order

Home Forums Community Forum Create Email Representative of Placed Order

This topic contains 16 replies, has 2 voices. Last updated by  Bruce 3 years, 8 months ago.

Topic Author Topic
Posted: Thursday Apr 11th, 2013 at 1:55 pm #47214

(PayPal Pro usage, the connection to paypal sandbox is functioning properly and sending all emails)

I see that **some** fields are going into the membership confirmation email from general email configuration and other fields are going into the paypal option field.

Task: We’d like to get a single email that represents the order.

I’ve read the documentation, and it states ” If you use PHP tags, please run a test email with print_r(get_defined_vars());” (which is almost the same as the internal $GLOBALS variable.) I can see the values are there, just probably have my placeholders wrong.

Standard s2Member fields used:

s2member_pro_paypal_checkout[first_name]
s2member_pro_paypal_checkout[last_name]
s2member_pro_paypal_checkout[email]
s2member_pro_paypal_checkout[username]
s2member_pro_paypal_checkout[password1]
s2member_pro_paypal_checkout[password2]
s2member_pro_paypal_checkout[street]
s2member_pro_paypal_checkout[city]
s2member_pro_paypal_checkout[state]
s2member_pro_paypal_checkout[zip]
s2member_pro_paypal_checkout[card_number] (Don’t care about these, for reference only)
s2member_pro_paypal_checkout[card_type]
s2member_pro_paypal_checkout[card_expiration]
s2member_pro_paypal_checkout[card_verification]
s2member_pro_paypal_checkout[country]
(all of the internally generated hidden fields)

Custom fields used:
s2member_pro_paypal_checkout[custom_fields][last_period]
s2member_pro_paypal_checkout[custom_fields][absorbancy]
s2member_pro_paypal_checkout[custom_fields][ordercomments]
s2member_pro_paypal_checkout[custom_fields][per_period]

Our shortcode (it’s actually dynamically generated, so this is one of three levels used)

[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="1 Box" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="(obscured).com" ta="" tp="1" tt="M" ra="9.00" rp="1" rt="M" rr="1" rrt="" rra="2" accept="paypal,visa,mastercard,amex,discover" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" success="https:/(obscured).com/dev/thank-you?user_email=%%user_email%%&full_name=%%full_name%%&street=%%street%%&city=%%city%%&state=%%state%%zip=%%zip%%&label%%label%%&subscr_id=%%subscr_id%%&initial=%%initial%%&recurring=%%recurring/regular_cycle%%&last_period=%%last_period%%&absorbancy=%%absorbancy%%&per_period=%%per_period%%&ordercomments=%%ordercomments%%" /]

(A second problem: none of our values are being passed in the thank you page, but we’re still working thorugh that and may figure it out.)

Our PayPal Options -> ProForm Email Configuration template. We’ve also put the same template in the General -> Email Configuration -> New User email as a test, and as mentioned, some values show in one, other values in the other.

Dear %%first_name%%,

Thank you for subscribing to (company name). Below are the details of your order:

Subscriber Information

%%full_name%%
%%user_email%%
%%street%%
%%city%%, %%state%% %%zip%%

Subscription Information

Subscription: %%label%%, %%item_name%%
Subscr. ID: %%subscr_id%%
Last Period: %%last_period%%
Per Period: %%per_period%%
Absorbancy: %%absorbancy%%

Charges today: $%%initial%%
Recurring charges: $%%recurring/regular_cycle%%

Comments/Special Instructions: %%ordercomments%%

You may review your subscription status at any time by using the user name and password you created during signup and logging in here:

%%wp_login_url%%

If you have any trouble, please feel free to contact us.

Best Regards,
(company)

Result for Signup Confirmation email: user_email, all address info, label, last period, per_period, absorbancy, ordercomments, (level) label, WP login URL are all blank.

Result for the user name/password email: full_name, all address info, item_name, subscriber ID, initial, recurring/regular_cycle are all blank, but the fields that are missing in the first email are all present here.

We really don’t care which email we use, or that it sends two, but need to figure out how to get all of the order info into one email. What am I missing?

List Of Topic Replies

Viewing 16 replies - 1 through 16 (of 16 total)
Author Replies
Author Replies
Posted: Thursday Apr 11th, 2013 at 4:50 pm #47228

Added: we’ve been walking through setting up the thank you page in the interim (see above) and these two issues might be related. With a dump of various variables, we can see that many of the values are getting nuked, and they’re all the ones missing from the signup confirmation email (example: city, state, zip, etc.) These are straight from the default paypal-checkout-form.php, unaltered. Any idea why they are posting **empty?**

The issue with that will probably solve the email issue (I hope.)

Posted: Thursday Apr 11th, 2013 at 5:34 pm #47231

Added yet again:

I’ve set up some tests that may help determine what’s going wrong. I temporarily removed the success= redirect and have it immediately doing some var_dumps on submit.

If I understand it correctly, the shortcode is used twice: first to load the form, second to process any redirects.

With the redirect removed, on submit, the values for city, state. etc. are all in $_POST. They are still present after a successful curl to payPal. Even in this condition, those values are empty in the emails.

Somewhere in s2 it’s nuking the values for these fields, they aren’t showing up in the thank you page (with the success= re-enabled) or in the emails.

Posted: Thursday Apr 11th, 2013 at 7:01 pm #47234

I’ve tracked it as far down as paypal-checkout-in-inc.php and found that even at that point the internal variable $post_vars **STILL contains these missing values. We’ve almost got this finished, please let us know what’s going wrong here or where to look.

Posted: Friday Apr 12th, 2013 at 12:35 pm #47314

Need to solve this today, please.

Alternatively is there a hook we can grab like after_billing_success and create our own email process? That would work, I’ll dig thruogh more documentation and the classes to see if it’s possible.

Posted: Friday Apr 12th, 2013 at 6:20 pm #47338
Bruce
Username: Bruce
Staff Member

Thank you for reporting this important issue.

Do you have logging enabled? It looks like maybe you’re actually not receiving any of the values you’re looking for, possibly due to a plugin on your system?

Please submit your log files to us via Private Contact Form:

s2Member® » Private Contact Form

Posted: Friday Apr 12th, 2013 at 6:33 pm #47342

Bruce – thank you for looking. Private form won’t be necessary, it’s sandboxed at PayPal. Here’s one entry from paypal-api-log, form data is submitting fine. Note how city, state, zip, etc. are all intact (I have descended to the point of just rattling the keyboard for some fields like fghfdhfghf.)

The problem is, part of the data is available to the user signup, the other parts to the new user registration email, and those also go missing from the thank you URL but in all cases, address, city, state, zip go empty (details above.)

Closest I can figure is it happens after curling payPal and getting a response.

LOG ENTRY: Thu Apr 11th, 2013 @ precisely 10:54 pm UTC
PHP v5.3.21 :: WordPress® v3.5.1 :: s2Member® v130221 :: s2Member® Pro v130221
Memory 3.46 MB :: Real Memory 4.00 MB :: Peak Memory 3.50 MB :: Real Peak Memory 4.00 MB
(obscured).com/dev/checkout
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
-------- Input vars: ( Thu Apr 11, 2013 10:54:23 pm UTC ) --------
array (
  'METHOD' => 'CreateRecurringPaymentsProfile',
  'EMAIL' => 'webdev@(obscured).com',
  'FIRSTNAME' => 'bill',
  'LASTNAME' => 'testing',
  'SUBSCRIBERNAME' => 'bill testing',
  'DESC' => '2 Boxes',
  'PROFILEREFERENCE' => '1368356063:0 D:1 M~(obscured).com~2',
  'INITAMT' => '17.00',
  'FAILEDINITAMTACTION' => 'CancelOnFailure',
  'CURRENCYCODE' => 'USD',
  'AMT' => '17.00',
  'TAXAMT' => '0.00',
  'MAXFAILEDPAYMENTS' => '2',
  'AUTOBILLOUTAMT' => 'AddToNextBilling',
  'PROFILESTARTDATE' => '2013-05-12T00:00:00Z',
  'BILLINGPERIOD' => 'Month',
  'TOTALBILLINGCYCLES' => '0',
  'BILLINGFREQUENCY' => '1',
  'CREDITCARDTYPE' => 'Visa',
  'ACCT' => '************3972',
  'EXPDATE' => '042018',
  'CVV2' => '123',
  'STREET' => 'fghfgh',
  'CITY' => 'fdhghg',
  'STATE' => 'ca',
  'COUNTRYCODE' => 'US',
  'ZIP' => '56789',
  'VERSION' => '71.0',
  'USER' => '(obscured).com',
  'PWD' => '1364319780',
  'SIGNATURE' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31AmWWBw7udQZarMmEHCHu-fnNQROx',
)
-------- Output string/vars: ( Thu Apr 11, 2013 10:54:27 pm UTC ) --------
PROFILEID=I%2d014UK2AERVYG&PROFILESTATUS=PendingProfile&TRANSACTIONID=8J152958YA825620L&TIMESTAMP=2013%2d04%2d11T22%3a54%3a27Z&CORRELATIONID=4425d8921165e&ACK=Success&VERSION=71%2e0&BUILD=5650305
array (
  'PROFILEID' => 'I-014UK2AERVYG',
  'PROFILESTATUS' => 'PendingProfile',
  'TRANSACTIONID' => '8J152958YA825620L',
  'TIMESTAMP' => '2013-04-11T22:54:27Z',
  'CORRELATIONID' => '4425d8921165e',
  'ACK' => 'Success',
  'VERSION' => '71.0',
  'BUILD' => '5650305',
)
Posted: Friday Apr 12th, 2013 at 6:42 pm #47348
Bruce
Username: Bruce
Staff Member

Thanks for the info.

I’m working with testing this functionality in the current release. I notice you’re running 130221, and I’d recommend upgrading before going any further. Also, while I’m working on seeing if I can find the issue here, could your run our Server Scanner? It’ll rule out the possibility of something obvious, like your installation not being in UTF-8 mode.

See: Knowledge Base » s2Member® Server Scanner

Posted: Friday Apr 12th, 2013 at 6:54 pm #47349

I just updated it today, and ran the server scanner yesterday (passed all tests.) That log entry was from just earlier (after the update,) don’t know why it shows that version.

Version:    130406
Stable tag:    130406


SSL Compatible:    yes.....(etc)
  
Posted: Friday Apr 12th, 2013 at 6:58 pm #47352

Just re-ran, we have a checksum warning (because we had to mod custom-fields-inc.php – long story) and a memory warning, we’ve only got 40MB. I chased all those yesterday, it’s unrelated (see results above, custom fields are working in one email, not the other.)

Posted: Monday Apr 15th, 2013 at 12:46 pm #47503

I’m working with testing this functionality in the current release.

So what did you find? Today is this client’s launch day and these are the last two pieces for this project, appreciate any advice.

Our two options are: figure out why the form values of city, state, zip etc are not populating (they are empty when they get to email and thank you page,) or let us know the best hook to intercept the email process so we can create our own email handler.

Posted: Monday Apr 15th, 2013 at 7:45 pm #47548
Bruce
Username: Bruce
Staff Member

Our two options are: figure out why the form values of city, state, zip etc are not populating (they are empty when they get to email and thank you page,) or let us know the best hook to intercept the email process so we can create our own email handler.

I’ve been unable to recreate an issue in my test environment. In the mean time, you can use the standard wp_mail filter WordPress sets up to filter these emails.

Posted: Monday Apr 15th, 2013 at 7:49 pm #47550

Does that mean city, state, zip are working fine in your test and appear in both the emails and thank you pages or that you haven’t been able to attempt it?

Posted: Monday Apr 15th, 2013 at 7:58 pm #47554
Bruce
Username: Bruce
Staff Member

Does that mean city, state, zip are working fine in your test and appear in both the emails and thank you pages or that you haven’t been able to attempt it?

I’ve been able to get Custom Profile/Registration Fields to show up just fine in the New User Registration Email just fine.

Posted: Monday Apr 15th, 2013 at 9:07 pm #47562

So what’s wrong with out code? It’s all right there.

Posted: Monday Apr 15th, 2013 at 9:10 pm #47563
Bruce
Username: Bruce
Staff Member

So what’s wrong with out code? It’s all right there.

To be totally honest I’m not sure what’s wrong with your email set up. It should be working just fine but s2Member is not picking up the replacement codes, apparently. If you could send us a Dashboard Login via Private Contact Form it’s possible we could find the issue.

Posted: Monday Apr 15th, 2013 at 9:11 pm #47564
Bruce
Username: Bruce
Staff Member
Viewing 16 replies - 1 through 16 (of 16 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.