Hi @nadhonar
This option is not currently available, but it is planned to be added in the redesign of the SMS sending page in future updates.
However, for now, You can use the wp_sms_single_dispatch_arguments filter.
For more information and how to use this filter, please refer to the link below:
https://wp-sms-pro.com/resources/filter-wp_sms_single_dispatch_arguments/
Please let me know if you have any further questions or need assistance.
Regards,
-
This reply was modified 1 year, 10 months ago by
Amir.
Thread Starter
Mo
(@nadhonar)
Right; Could you please provide me the filter code in order to insert {display_name} into the content message.
Regards
An example should be like this
add_filter('wp_sms_single_dispatch_arguments', function ($arguments) {
// Retrieve the subscriber by mobile number
$subscriber = \WP_SMS\Newsletter::getSubscriberByMobile($arguments['to']);
// Retrieve the user by phone number
$user = \WP_SMS\Helper::getUserByPhoneNumber($arguments['to']);
// If the subscriber exists, replace {display_name} with the subscriber's name
if ($subscriber) {
$arguments['msg'] = str_replace('{display_name}', $subscriber->name, $arguments['msg']);
}
// If the user exists, replace {display_name} with the user's display name
elseif ($user) {
$arguments['msg'] = str_replace('{display_name}', $user->display_name, $arguments['msg']);
}
// Return the modified arguments
return $arguments;
});
Please consider the Delivery Method in the settings should be set on “Batch SMS Queue“
Best