Skip to content

Send Command Word

sendEmail

php
\FresnsCmdWord::plugin('Fresns')->sendEmail($wordBody);
Parameter NameTypeRequiredDescription
emailStringrequiredemail
titleStringrequiredtitle
contentStringrequiredcontent (HTML code support)

sendSms

php
\FresnsCmdWord::plugin('Fresns')->sendSms($wordBody);
Parameter NameTypeRequiredDescription
countryCodeNumberrequiredInternational area code
phoneNumberNumberrequiredPhone number
signNameStringoptionalSMS signature name
templateCodeStringrequiredTemplate parameter
templateParamObjectoptionalVariable parameters
View the templateParam format for variable parameters
json
// Variable names correspond to actual values
{
    "nickname": "Jevan Tang",
    "variale1": "Someone mention you"
}

sendNotification

php
\FresnsCmdWord::plugin('Fresns')->sendNotification($wordBody);
Parameter NameTypeRequiredDescription
uidNumberrequiredUser parameter (main user table users->uid field)
typeNumberrequired1. System / 2. Recommend / 3. Like / 4. Dislike / 5. Follow / 6. Block / 7. Mention / 8. Comment / 9. Quote
contentStringoptionalNotification content
isMarkdownBooleanoptionalIs the content in MD format?
isMultilingualBooleanoptionalIs the content multilingual?
isAccessPluginBooleanoptionalAccess plugin page?
pluginFskeyStringoptionalAssociated plugin
actionUidNumberoptionalTrigger initiator
actionIsAnonymousBooleanoptionalIs anonymous
actionTypeNumberoptionalTrigger action type 1.Like 2.Dislike 3.Follow 4.Block 5.Publish 6.Edit 7.Delete 8.Sticky 9.Digest 10.Manage
actionObjectNumberoptionalTrigger target 1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment 6.Post Log 7.Comment Log 8.Extend Content
actionFsidNumber / StringoptionalTrigger target Fsid
contentFsidStringoptionalContent event pid or cid
The published content itself, the action that it triggers
content Description

If the isMultilingual parameter is for multiple languages, the content parameter is a JSON content passed as a string.

json
[
    {
        "langTag": "en",
        "content": "Content of notice"
    }
]

sendAppNotification

php
\FresnsCmdWord::plugin('Fresns')->sendAppNotification($wordBody);
Parameter NameTypeRequiredDescription
uidNumberrequiredUser parameter (main user table users->uid field)
channelNumberrequiredChannel 1.iOS / 2.Android
templateStringoptionalTemplate parameter
coverUrlStringoptionalCover image URL
titleStringoptionalTitle
contentStringoptionalContent
timeStringoptionalTime, format Y-m-d H:i:s
linkTypeNumberoptionalLink type: 1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
linkFsidNumber / StringoptionalAfter passing the link type parameter, this parameter is required, the fsid of the type
linkUrlStringoptionalLink URL
channel Description
  • Get notification configuration plugins send_ios_service, send_android_service based on channel
  • Leaving it blank means both need to be pushed, requesting plugins for both configurations separately.

sendWechatMessage

php
\FresnsCmdWord::plugin('Fresns')->sendWechatMessage($wordBody);
Parameter NameTypeRequiredDescription
uidNumberrequiredUser parameter (main user table users->uid field)
channelNumberrequiredChannel 1.Official Account / 2.Mini Programs
templateStringoptionalTemplate parameter
coverUrlStringoptionalCover image URL
titleStringoptionalTitle
contentStringoptionalContent
timeStringoptionalTime, format Y-m-d H:i:s
linkTypeNumberoptionalLink type: 1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
linkFsidNumber / StringoptionalAfter passing the link type parameter, this parameter is required, the fsid of the type
linkUrlStringoptionalLink URL

Released under the Apache-2.0 License