imports/vx/server/daemon/mailman.js
/**
     * Perform the actual SMS send via Twilio and update the notification record accordingly.
     *
     * @param {object} Notification to send.
     */
Perform the actual SMS send via Twilio and update the notification record accordingly.
@param {object} Notification to send.
Perform the actual SMS send via Twilio and update the notification record accordingly . @param { object } Notification to send .
async sendSms(notification) {
        const mobile = Util.getProfileValue("mobile", notification.recipientId)
        const message = Util.i18n(notification.key, notification.variables)
        const body = Util.i18n("common.template_subject", { message : message })
        OLog.debug(`mailman.js sendSms notificationId=${notification._id} mobile=${mobile} body=[${body}]`)
        if (!mobile || mobile.trim().length === 0) {
            OLog.debug(`mailman.js sendSms recipientId=${notification.recipientId} no mobile number bypassing send`)
            VXApp.updateNotification(notification._id, "SMS", [ "processed" ])
            return
        }
        const result = Service.sendSms(notification.domain, mobile, body)
        if (!result.success) {
            VXApp.updateNotification(notification._id, "SMS", [ "processed" ])
            return
        }
        VXApp.updateNotification(notification._id, "SMS", [ "processed" ])
    }
async sendSms ( notification ) { const mobile = Util . getProfileValue ( "mobile" , notification . recipientId ) const message = Util . i18n ( notification . key , notification . variables ) const body = Util . i18n ( "common.template_subject" , { message : message } ) OLog . debug ( ` ${ notification . _id } ${ mobile } ${ body } ` ) if ( ! mobile || mobile . trim ( ) . length === 0 ) { OLog . debug ( ` ${ notification . recipientId } ` ) VXApp . updateNotification ( notification . _id , "SMS" , [ "processed" ] ) return } const result = Service . sendSms ( notification . domain , mobile , body ) if ( ! result . success ) { VXApp . updateNotification ( notification . _id , "SMS" , [ "processed" ] ) return } VXApp . updateNotification ( notification . _id , "SMS" , [ "processed" ] ) }
Perform the actual SMS send via Twilio and update the notification record accordingly.
Perform the actual SMS send via Twilio and update the notification record accordingly .
// If the user didn't set up a mobile number, just bypass SMS: