MarketPress Custom Placeholder

How can I create custom Placeholder with custom output for MarketPress notification emails without modifying the plugin core files?

  • Rupok
    • Support Ninja

    Hi Pat,

    I’ve already pinged our SLS people. I believe they will come up with their valuable feedback on this very soon. But as they are always busy with works, it might take a little time.

    I’ll really appreciate your patience. You will get a notification as soon as any reply is posted in this thread.

    Have a nice day. Cheers!


  • Vaughan
    • Support/SLS MockingJay

    Hi Pat

    What kind of placeholders are you wanting to replace? I mean, can you give me an example of what you’re wanting to accomplish?

    It could be possible by replacing mp_send_mail() function itself as it’s a template function in Marketpress that checks if the function_exists().

    So you could perhaps just add the function to your theme functions.php or a mu-plugin

    Something like below for example:

    function mp_send_email( $email, $subject, $msg, $attachments = array() ) {
    $placeholders = array(

    $replacements = array(
    'simple text replacement', // PLACEHOLDER1
    custom_function(), // PLACEHOLDER2
    custom_function_two(), // PLACEHOLDER3

    $msg = str_replace($placeholders, $replacements, $msg);

    return MP_Mailer::get_instance()->send( $email, $subject, $msg, $attachments );


    function custom_function() {
    // do something & return the result

    $content = date('Y-m-d');

    return $content;

    function custom_function_two() {
    // do something & return the result

    $content = date('H:i');

    return $content;

    In this Case say we have a notification email with content:

    This is a sample email that contains some placeholders below:


    The date is: PLACEHOLDER2

    The time is: PLACEHOLDER3

    Using the above functions the email would be changed to:

    This is a sample email that contains some placeholders below:

    simple text replacement

    The date is: 2018-06-01

    The time is: 04:16

    Hope this helps

  • Pat
    • Flash Drive

    My original goal was to be able to edit the ORDERINFO output to allow for styling and remove unwanted information. My intention was to find a way to create this as a new placeholder to avoid having to touch plugin code.

    I will look at your sample to see if I can make it work for my purpose :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.