[WordPress] 外掛分享: All Path Messaging

WordPress 外掛 All Path Messaging 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「All Path Messaging」是 2024-10-14 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2024-10-27,距離現在已有 189 天。
  • 外掛最低要求 WordPress 4.4 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

souptik |

外掛標籤

sms | email | messaging | push notification |

內容簡介

總結:
這個 WordPress 外掛提供了無限通訊功能,讓你在一個方案中處理郵件、簡訊和推播通知。你可以輕鬆取得多種預先設置的服務提供商,或者自行開發插件以實現自定義通訊功能。

問題與答案:
1. 這個 WordPress 外掛提供了哪些通訊方式?
- 郵件、簡訊和推播通知。
2. 如果我不想使用預設的簡訊服務提供商,該外掛預設提供了哪些服務提供商?
- 外掛提供了多種預先實現的提供商供你選擇。
3. 如果我想使用一個不常見的電子郵件提供商該怎麼辦?
- 作為開發者,只需編寫自己的插件並實現自己的適配器,就能與 WordPress 消息功能輕鬆連接。可參考相應的部分以實施適配器。

原文外掛簡介

Check out the Github Repository ♥
Limitless Communication: All-in-one, super scalable, messaging Solution for WordPress.
Ok hold on! ✋. So, many words in one line.
Let’s understand each one-by-one.

All-in-one: What do you want? – Email, SMS, push-notification? Get all-in-one.

But I don’t want to use xyz provider for SMS, I want to use pqr, can I have that? Yes it provides you with lot of pre implemented providers for all email, sms and push-notification.

Super Scalable: But I want to use an email provider named yxr you haven’t heard the name of. Now what? 🧐

No worries! Are you a developer? If yes, just write your own plugin and implement your own adapter and see it nicely hooked-up with “WordPress messaging”. Please refer to this section for implementing adapters.

And that’s how it provides Limitless communication! 🚀

Quick Links
Setup ⚙️ | Issues | Services and functions 🧩 | Create your own Adapter 🛠️
Coming soon ⏳

Push notifications
Email Testing page
SMS Testing page
Push notifications Testing page

Examples
Email 📧📨
Send an email through a particular adapter (with headers 😉) –
\Souptik\AllPathMessaging\Email\send(
[ '[email protected]' ],
'Yay its working!',
'This is some long mail body.',
'Souptik',
'[email protected]',
[
'cc' => [
[
'name' => 'CC Test',
'email' => '[email protected]',
],
],
'attachments' => [
trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-all-path-messaging.php',
'SameFileDifferentName.php' => trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-all-path-messaging.php',
],
],
'mailgun'
);

Just remove the last parameter! And now it uses the default selected adapter –
\Souptik\AllPathMessaging\Email\send(
[ '[email protected]' ],
'Yay its working!',
'This is some long mail body.',
'Souptik',
'[email protected]',
[
'cc' => [
[
'name' => 'CC Test',
'email' => '[email protected]',
],
],
'attachments' => [
trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-all-path-messaging.php',
'SameFileDifferentName.php' => trailingslashit( WP_CONTENT_DIR ) . '/mu-plugins/test-all-path-messaging.php',
],
],
);

Checked the override wp_mail checkbox? Try a simple wp_mail! –
wp_mail(
[ '[email protected]' ],
'Yay its working!',
'This is some long mail body - from wp_mail.',
[],
[]
);

SMS 📲
Send a SMS through a particular adapter –
\Souptik\AllPathMessaging\SMS\send( [ '+xxxxxxxxxxxx' ], 'Yay its working!', 'twilio' );

Just remove the last parameter! And now it uses the default selected adapter –
\Souptik\AllPathMessaging\SMS\send( [ '+xxxxxxxxxxxx' ], 'Yay its working!' );

Creating your own adapter 🛠️
Here comes the cool part fellow developers! 💻
Tip: I have provided a dummy adapter for each service at inc//adapters/dummy/.
Consider that as the starting point and let’s understand what each file does.

Let’s start with namespace.php. It is the entry point of your adapter.

In that you will see a simple bootstrap function.
In that function we are hooking into EMAIL_SLUG . '_adapters' and registering our adapter.
We pass the following data –
slug
name
adapter class object.
options – An array defining the settings required for this adapter, which will be used to automatically display the options on the settings page.

Next is class-adapter.php, which is the Adapter class, which we initialized in the above file and passed it to adapter. It contains three simple functions –

get_settings_fields – This is the function which returns the array of options, which we used in the above file for options. Each option, will have –
The key as the name of the option.
And three values –

label – Label to display in the settings page beside the input.
type – Type of the field.
sanitize_callback

get_settings – This function returns an associative array, whose keys are the name of the options and the value as the value of the options.
get_adapter – This function will just return the core provider class, which is responsible for processing the message.
First check if Utopia Messaging already provides the provider or not here, for example Utopia\Messaging\Adapter\Email\Mailgun.
If it is present just use it. Easy peasy! ✨
But if not, let’s code it ourself, because Utopia Messaging makes it so easy to create a new adapter!

class-dummy.php is for that purpose, assuming you don’t get a provider already present in Utopia Messaging.

It’s basically a child class of EmailAdapter or SMSAdapter, which abstract a lot of stuff for us!
Let me explain two main functions, _construct and process. Rest of the functions and properties are self-explanatory! 😉
In the _construct function just put the arguments which you want to accept. That’s it! And now they will be available everywhere else as $this->param_name!
The process function is the place where you have to write the main logic of calling your providers API to send the message.

As said above all the credentials/data you accepted through constructor are available as $this->param_name.
Build the body and the headers.
And then you can use the $this->request function as demonstrated in the dummy!
Create a response using Utopia’s Response class.
Handle the errors, populate the response, return! Done! 🚀

External services
Brevo
This plugin connect’s to Brevo’s API to send emails through Brevo. This is the API it sends the request to.
The request is send everytime a mail is sent, and Brevo is selected as the default adapter from the plugin settings (or the function to send email through Brevo is directly invoked in the code).
Here is the Terms of Use and Privacy Policy of the service.
AWS SES
This plugin connect’s to AWS SES’s API to send emails through AWS SES.
The request is send everytime a mail is sent, and AWS SES is selected as the default adapter from the plugin settings (or the function to send email through AWS SES is directly invoked in the code).
Here is the Terms of Use and Privacy Policy of the service.
Mailgun
This plugin connect’s to Mailgun’s API to send emails through Mailgun.
The request is send everytime a mail is sent, and Mailgun is selected as the default adapter from the plugin settings (or the function to send email through Mailgun is directly invoked in the code).
Here is the Terms of Use and Privacy Policy of the service.
Telesign
This plugin connect’s to Telesign’s API to send SMS through Telesign.
The request is send everytime the function to send SMS is invoked with the Adapter as Telesign or the default adapter is set as Telesign.
Here is the Terms of Use and Privacy Policy of the service.
Twilio
This plugin connect’s to Twilio’s API to send SMS through Twilio.
The request is send everytime the function to send SMS is invoked with the Adapter as Twilio or the default adapter is set as Twilio.
Here is the Terms of Use and Privacy Policy of the service.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「All Path Messaging」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0.0 | trunk |

延伸相關外掛(你可能也想知道)

文章
Filter
Apply Filters
Mastodon