Page 1 of 1

Custom Capability Email - Urgent :)

PostPosted: October 24th, 2011, 4:27 pm
by lmllewellyn
HI, where can I modify the email that gets sent to customers who purchase a custom capability through authorize.net pro forms?

Thanks!

Re: Custom Capability Email - Urgent :)

PostPosted: October 24th, 2011, 5:35 pm
by Eduan
Try under WP Admin -> s2Member -> Authorize.Net® Options.

Please tell me if you solved your problem, or not.

Re: Custom Capability Email - Urgent :)

PostPosted: October 24th, 2011, 5:46 pm
by lmllewellyn
I only see a place to change the signup email and the page/post email, not the custom capabilities email.

Re: Custom Capability Email - Urgent :)

PostPosted: October 25th, 2011, 11:56 pm
by Cristián Lávaque
I'm emailing Jason to ask him about this.

Re: Custom Capability Email - Urgent :)

PostPosted: October 26th, 2011, 12:06 pm
by Jason Caldwell
Thanks for bringing this thread to my attention.

There is currently no UI panel configuration area for this particular email. However, it IS possible to modify the basic transactional subject line and message that s2Member uses in this scenario.

Please create this directory and file:


/wp-content/mu-plugins/s2-hacks.php ( these are MUST USE plugins, that's what you want )
Reference article: http://codex.wordpress.org/Must_Use_Plugins
Code: Select all
<?php
/* Your own custom subject line. */
add_filter ("ws_plugin__s2member_capabilities_email_sbj", "my_s2_ccaps_email_sbj");
function my_s2_ccaps_email_sbj ($sbj, $vars = array ())
    {
        return "Thank you! Your account has been updated.";
    }
/* Your own custom message body. */
add_filter ("ws_plugin__s2member_capabilities_email_msg", "my_s2_ccaps_email_msg");
function my_s2_ccaps_email_msg ($msg, $vars = array ())
    {
        return "Thank you! You now have access to:\n" . $vars["paypal"]["item_name"] . "\n\nPlease log back in now.\n" . wp_login_url ();
    }
?>
* Note, be sure there are NO leading or trailing spaces/tabs/line breaks, before or after <?php ?>

* Even though you see reference here to $vars["paypal"]["item_name"], this hack works for all Payment Gateways integrated with s2Member, because ultimately, all transactions are piped through s2Member's core PayPal processor, one way or the other.

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 9:46 am
by yamidemichaos
I try this for my Authorize.net Pro but not working...
I just to create a customized ID which random features which attached to the email... Please help urgent
Thanks in advance

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 11:15 am
by Raam Dev
yamidemichaos,

Can you please copy and paste what you put in /wp-content/mu-plugins/s2-hacks.php.

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 1:34 pm
by yamidemichaos
Code: Select all
<?php
    
/* Your own custom subject line. */
    
add_filter ("ws_plugin__s2member_capabilities_email_sbj""my_s2_ccaps_email_sbj");
    function 
my_s2_ccaps_email_sbj ($sbj$vars = array ())
        {
            return 
"Thank you! Your account has been updated.";
        }
    
/* Your own custom message body. */
    
add_filter ("ws_plugin__s2member_capabilities_email_msg""my_s2_ccaps_email_msg");
    function 
my_s2_ccaps_email_msg ($msg$vars = array ())
        {
            return 
"Thank you! You now have access to:\n" $vars["paypal"]["item_name"] . "\n\nPlease log back in now.\n" wp_login_url ();
        }
?>

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 1:43 pm
by Raam Dev
Thank you.

Can you explain what you mean by this:

yamidemichaos wrote:I just to create a customized ID which random features which attached to the email...

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 1:46 pm
by yamidemichaos
I still want to create a customized ID like a promo code which are unique to each clients but before that I need code function work on my end then try to integrate.

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:01 pm
by Raam Dev
Is this a separate issue from modifying the email? Did you successfully modify the Custom Capability Email or are you still having problems with that?

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:09 pm
by yamidemichaos
I think the same issue, making custom email, which I wanted to create custom id from database which connect to the future user who finished registration.
No sign of working.

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:14 pm
by Raam Dev
Can you write an example of the email that you want to send out? Include everything that you want to send in the email.

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:25 pm
by yamidemichaos
I know actually how to use php format mail but I don't why the code work on me. I'm using Authorize.net Pro edition and all email on s2member are fine, if a new user would register the s2member send the email template from the admin side instead I would like the custom one.
I just want the custom one to replace the admin template.
thanks for the patience :)

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:36 pm
by Raam Dev
Thank you for the additional information and the patience. :)

Are you trying to modify the Custom Capabilities email (the email that gets sent when an existing user makes a purchase for a Custom Capability to be added to their account) or are you trying to modify the email that is sent when a new user registers for an account?

The code that Jason suggested adding to s2-hacks.php is *not* for New User Registration emails -- it's for the notification of new Custom Capabilities purchased by an existing user.

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:38 pm
by yamidemichaos
I thinks that an awful mislead.
Do you have other reference? for what I needed.
Thanks

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:43 pm
by Cristián Lávaque
When a user creates an account, he gets the New User email. WP Admin -> s2Member -> General Options -> Email -> New User

When he pays he gets the confirmation email. WP Admin -> s2Member -> [gateway] Options -> Confirmation Email

If he pays to modify the access with a new level or custom capability, he gets a transactional email that currently has no interface in the admin area, but you can edit with a hack. The hack in this thread is to edit the email sent when new custom capabilities are purchased. There's another hack for the email sent to users when they change their level.

I hope that helps understand these better. :)

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:44 pm
by Raam Dev
You can modify the New Registration emails in WP-Admin -> s2Member -> General Options -> Email Configuration. Scroll to the bottom of that section and you'll see where you can modify the New User Email Message.

Let me know if that's what you're looking for. :)

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 2:47 pm
by yamidemichaos
So there is no hack for the new registered user?.. Because my client wanted to have the promo id to be included to the email template during registration.
He don't want to send it separately.
Thanks!

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 3:30 pm
by Raam Dev
If you'd like to include a special code in the Signup Confirmation Email, you can create your signup buttons with an included Custom Replacement Code.

For example, in the shortcode button that new users use to signup, you could add custom="example.com|promo-code1".

Then, in your Signup Confirmation Email (WP Admin -> s2Member -> Auth.Net Options -> Signup Confirmation Email (Pro Form)) you could add something to the body of the email that says "Promo Code: %%cv1%% ".

Whatever you used in the custom field of the shortcode button (after the domain), will show up in the Signup Confirmation Email. In this case, they would see "Promo Code: promo-code1".

Please read the Custom Replacement Codes section at the bottom of WP Admin -> s2Member -> Auth.Net Options -> Signup Confirmation Email (Pro Form) and let me know if that will work for you.

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 3:39 pm
by yamidemichaos
Promo codes are randomly from database. There is a database for that and client will get a unique promo code (e.g. 3000001 for clientA, 3000022 for clientB, 3232333 for clientC )
That's why I need some hack inorder to have that dynamic promo code
thanks :)

Re: Custom Capability Email - Urgent :)

PostPosted: November 15th, 2011, 7:36 pm
by Jason Caldwell
Thanks for bringing this thread back to my attention.

A UI panel configuration area, IS made available for the Signup Confirmation Email, so this hack is only required when/if you need to modify this email in more dynamic ways, which might not be possible with Replacement Codes alone. This hack follows pretty much the same format as the hack I posted earlier for the sale of Independent Custom Capabilities.

Please create this directory and file:

/wp-content/mu-plugins/s2-hacks.php ( these are MUST USE plugins, that's what you want )
Reference article: http://codex.wordpress.org/Must_Use_Plugins
Code: Select all
<?php
/* Your own custom subject line. */
add_filter ("ws_plugin__s2member_signup_email_sbj", "my_s2_signup_email_sbj");
function my_s2_signup_email_sbj ($sbj, $vars = array ())
    {
        return "Congratulations! ( your membership has been approved )";
    }
/* Your own custom message body. */
add_filter ("ws_plugin__s2member_signup_email_msg", "my_s2_signup_email_msg");
function my_s2_signup_email_msg ($msg, $vars = array ())
    {
        return "Thank you! You now have access to:\n" . $vars["paypal"]["item_name"];
    }
?>
* Note, be sure there are NO leading or trailing spaces/tabs/line breaks, before or after <?php ?>

* Even though you see reference here to $vars["paypal"]["item_name"], this hack works for all Payment Gateways integrated with s2Member, because ultimately, all transactions are piped through s2Member's core PayPal processor, one way or the other.

In s2Member's source code, these Filters are applied here at line #364:
viewtopic.php?f=40&t=14521&src_doc_v=111105#src_doc_line_364
See also: viewtopic.php?f=40&t=12778&src_doc_v=111105

Re: Custom Capability Email - Urgent :)

PostPosted: January 15th, 2012, 10:14 pm
by EidschunMedia
Jason,

We are looking to do something maybe similar. We want the email that the ADMIN receives when a new member joins to also include the membership they bought (60 day, 90 day, 12 mo, etc.) and the coupon code used (if any). What would be the easiest way to do this?

This was the closest thread I found so far to what we are trying to do.

Re: Custom Capability Email - Urgent :)

PostPosted: January 16th, 2012, 8:47 am
by Jason Caldwell
Thanks for your inquiry.

So sorry, s2Member does not currently pass through the Coupon Code itself. However, in the example above, $vars["paypal"]["item_name"] WILL include reference to the Coupon Code having been used, including the original purchase, along with whatever discount was applied. In addition, $vars["paypal"]["item_name"] will include the full desc="" attribute value from your Shortcode that was used to generate the Payment Button and/or s2Member Pro Form.

In the UI panel for s2Member's configuration of your Signup Confirmation Email, the value of $vars["paypal"]["item_name"] is referenced using the Replacement Code %%item_name%%. So you shouldn't need this hack at all, so long as you include whatever details you want to include in your desc="" attribute for the Shortcode.

SNAG-0010.png
SNAG-0010.png (31.46 KiB) Viewed 561 times
SNAG-0011.png



All of this being said... there are some additional values that could be used in the $vars["paypal"] array via the hack that I presented earlier. Here are a few that might help you.

Code: Select all
$vars["paypal"]["initial"] = the initial or trial amount of the sale.
$vars["paypal"]["initial_term"] = 1 D (would indicate an initial/trial period 1 Day). This is always a digit followed by a space, and then one of D,W,M,Y,L for Days, Weeks, Months, Years or Lifetimes.
$vars["paypal"]["regular"] = the regular and/or recurring amount associated with the sale.
$vars["paypal"]["regular_term"] = 1 M (would indicate the regular recurring or fixed-term term period). This is always a digit followed by a space, and then one of D,W,M,Y,L for Days, Weeks, Months, Years or Lifetimes. 
Others are available, but you'll need to check the source code here.