AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Closed] Custom Shortcode use in Email body and subject

5 Posts
2 Users
0 Reactions
1,231 Views
Posts: 8
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@blueli)
Active Member
Joined: 3 years ago
[#27094]

Hello. I am wondering if we could create our custom shortcode and use it for the email body?

Example. I have a shortcode [email_footer_logo] with a function to return a png file. Something like this. (I am planning a add a option for ACF option page. So the site manage can edit it from option page.

return '<p style="text-align: left;"><img src="https://example.com/wp-content/uploads/2022/11/vs-email-footer-logos.png" style="max-width: 520px; width: 100%; height: auto";/></p>';
}

 

However. When I placed it into the email body. It does not return anything. 

Plus. I like to use TranslatePress Shortcode for translating email body, I use this way with Woocommerce Email and it works. Their shortcodes are ike:
[trp_language language="en_HK"]
Content here will be only for en_HK visitor
[/trp_language]

[trp_language language="zh_HK"]
Content here will be only for zh_HK visitor
[/trp_language]

These shortcode wraps do not work either... 

Any workaround we can add support to this?

 

Thanks


4 Replies
Chris
Posts: 3610
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@chris)
Famed Member
Joined: 5 years ago

Hi @blueli,

Are those WordPress Shortcodes ? If yes, we can add them.


Posts: 8
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@blueli)
Active Member
Joined: 3 years ago

Yes it is WordPress Shortcodes I guess?

The shortcodes are added via add_shortcode()

FYI

add_shortcode( 'email_footer_logo', 'email_footer_logo');

function email_footer_logo() {
return '<p style="text-align: left;"><img src="https://example.com/wp-content/uploads/2022/11/vs-email-footer-logos.png" style="max-width: 520px; width: 100%; height: auto";/></p>';
}

 

Thanks


Chris
Posts: 3610
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@chris)
Famed Member
Joined: 5 years ago

Hi @blueli,

We have added WordPress shortcode for the new version of wpForo.


Posts: 8
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@blueli)
Active Member
Joined: 3 years ago

Thanks! That is fast, will test it later today!


Share: