• Hello, this plugin works perfect when sending custom order notification. I am using Woocommerce Subscription with 3 subscription products (variable). I would like to include WordPress user id of that particular customer in custom order notification html email. I couldn’t find a short code for this. Can you please help. Thank you.

    https://samplesite.com/wp-admin/user-edit.php?user_id=2&wp_http_referer=%2Fwp-admin%2Fusers.php%3Fupdate%3Dadd%26id%3D2

Viewing 15 replies - 1 through 15 (of 22 total)
  • Hi @shamsdev,

    Thanks for reaching out.

    I have escalated your request to the development team. They will get back to you as soon as possible.

    Kind regards,
    Moshtafizur

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @shamsdev,

    I think what you need is our [order_func] shortcode:

    [order_func func="get_user_id"]

    Please give it a try and let me know what you think.

    Thread Starter shamsdev

    (@shamsdev)

    Thank you so much. This is what I want sir. Can I use this [order_func func=”get_user_name”] in order to show customer username? I would like to go with you premium cuz I want to send custom emails for subscription variable products.

    Plugin Author Algoritmika

    (@algoritmika)

    As customer’s username is not stored in order directly, we can’t use the [order_func] shortcode, unfortunately. However, let me try to add it to the plugin.

    P.S. Just in case – you can display customer’s first/last name with:

    [order_func func="get_billing_first_name"]
    [order_func func="get_billing_last_name"]
    Thread Starter shamsdev

    (@shamsdev)

    Great. Thank you so much. I will test it now. Can I use any standard woocommerce placeholders in [order_func] shortcode?

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @shamsdev,

    Can I use any standard woocommerce placeholders in [order_func] shortcode?

    I’m not sure if I got the question correctly. Could you please give me an example?

    Thread Starter shamsdev

    (@shamsdev)

    Hi, I mean placeholder like {order_date}

    Thread Starter shamsdev

    (@shamsdev)

    I successfully managed to send custom email for one Woocommerce subscription product called “Student Subscription” (We also have other subscription product like Parents subscrition, Teachers Subscription etc.). I have 3 variable products under this Student subscription like Basic, Silver, Gold (customer can only subscribe one product at a time). I need to send only 1 custom email to this Student subscription order. Is there any method to show text message based on product variation. For example.

    <if product id=”1421″> Thank you for purchasing Students Basic Membership </if>
    <if product id=”1422″> Thank you for purchasing Students Silver Membership </if>
    <if product id=”1423″> Thank you for purchasing Students Gold Membership </if>

    Thank you.

    
    
      
    • This reply was modified 1 year, 9 months ago by shamsdev.
    • This reply was modified 1 year, 9 months ago by shamsdev.
    Plugin Author Algoritmika

    (@algoritmika)

    Hi, @shamsdev,

    Hi, I mean placeholder like {order_date}

    I’m still not sure if I got the question right, but to get the order date with the [order_func] shortcode, you would do something like this:

    [order_func func="get_date_created"]

    Please note that as the get_date_created() function returns WC_DateTime class object, the output will be similar to this: 2023-05-10T17:15:09+00:00.

    Generally, in the [order_func] shortcode, you can use all the functions listed in the WC_Order class documentation. However, please note that not all return types (e.g., array) will be outputted as expected. So probably you mostly will be using functions which return scalar types, e.g., string. Also, currently, you can only use functions that do not have any required params.

    Is there any method to show text message based on product variation.

    I would suggest taking a simpler approach. The [order_item_names] shortcode will output all order products (comma-separated), so instead of using multiple if, you could do this:

    Thank you for purchasing [order_item_names]

    As you only allow your customers to have one product in the order, this should solve the task.

    If you still prefer to use if – there is [if] shortcode in the plugin. Currently, you can’t use product IDs, however, you can use product names:

    [if value1="{order_item_names}" value2="Students Basic Membership" operator="equal"]Thank you for purchasing Students Basic Membership[/if]
    [if value1="{order_item_names}" value2="Students Silver Membership" operator="equal"]Thank you for purchasing Students Silver Membership[/if]
    [if value1="{order_item_names}" value2="Students Gold Membership" operator="equal"]Thank you for purchasing Students Gold Membership[/if]

    Please give it a try and let me know what you think.

    Thread Starter shamsdev

    (@shamsdev)

    Hi, thank you. I used the following code to show the message.

    [if value1=”{member}” value2=”Students Basic Membership” operator=”equal”]Thank you for purchasing Students Basic Membership[/if]

    [if value1=”{silver}” value2=”Students Silver Membership” operator=”equal”]Thank you for purchasing Students Silver Membership[/if]

    [if value1=”{gold}” value2=”Students Gold Membership” operator=”equal”]Thank you for purchasing Students Gold Membership[/if]

    Here, member, silver, gold are the variable products. Unfortunately, it is not working. Am I missing something?

    Plugin Author Algoritmika

    (@algoritmika)

    Hi, @shamsdev,

    You don’t need to change the value1, it should be exactly the same as in my example, i.e.:

    value1="{order_item_names}"

    The only option you may want to change is value2 – this should match your product names.

    Thread Starter shamsdev

    (@shamsdev)

    Hi, Thank you for the update. Unfortunately it is not working. I used the following method,

    [if value1=”{order_item_names}” value2=”Basic” operator=”equal”]Thank you for purchasing Students Basic Membership[/if]

    [if value1=”{order_item_names}” value2=”Silver” operator=”equal”]Thank you for purchasing Students Silver Membership[/if]

    [if value1=”{order_item_names}” value2=”Gold” operator=”equal”]Thank you for purchasing Students Gold Membership[/if]

    Basic, Silver, Gold are the name of the variables.

    Because it is a variable subscription product, I have been included these variable products in the “required product” section of custom email settings page. Still, I receive email but the above thank you message is not showing.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi, @shamsdev,

    You need to use the full product name, i.e., include the main variable product name:

    Student Subscription - Silver

    so your final shortcode would look like this:

    [if value1="{order_item_names}" value2="Student Subscription - Silver" operator="equal"]Thank you for purchasing Students Silver Membership[/if]
    Thread Starter shamsdev

    (@shamsdev)

    Hi, the subscription product name is ‘Student Subscription’. The variables names are Member, Silver and Gold. Here we didn’t use ‘Student Subscription – Silver’ as product name anywhere.

    Let me try with both name together. Thank you for your support.

    • This reply was modified 1 year, 9 months ago by shamsdev.
    Thread Starter shamsdev

    (@shamsdev)

    Hi, I tried all the method that you suggested. Not working. I quit. ?? Thanks for your support.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Include User ID in custom email’ is closed to new replies.