Skip to content

Send Command Word

Verify Code

sendEmail

php
\FresnsCmdWord::plugin('Fresns')->sendEmail($wordBody);
Parameter NameTypeRequiredDescription
emailStringrequiredemail
titleStringrequiredtitle
contentStringrequiredcontent (HTML code support)
langTagStringoptionalLanguage tag, empty to use the default language tag
Used to handle variable values such as site name and time formats.

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
contentArrayoptionalNotification content
isMarkdownBooleanoptionalIs the content in MD format?
isAccessAppBooleanoptionalAccess app page?
appFskeyStringoptionalAssociated app
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
actionTargetNumberoptionalTrigger 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
php
[
    'langTag' => 'Content',
    'en' => '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 / 3.Desktop
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 apps send_ios_service, send_android_service based on channel
  • Leaving it blank means both need to be pushed, requesting apps for both configurations separately.

Released under the Apache-2.0 License