Add option to skip SMS notification if push notification succeeds

This commit is contained in:
Kijin Sung 2022-08-15 21:36:45 +09:00
parent 019aa525c6
commit ae5cc1a15e
5 changed files with 23 additions and 5 deletions

View file

@ -128,6 +128,8 @@ $lang->dont_check_notify_delete = 'Unread notifications will be deleted, too.';
$lang->user_notify_setting = 'User notify setting.';
$lang->about_user_notify_setting = 'Each member can set a notify settings. Warning! If a member setting not use notifications, they will not be notified regardless of their default settings.';
$lang->msg_not_use_user_setting = 'user setting\'s not use. Please contact your administrator.';
$lang->ncenterlite_push_before_sms = 'Try Push before SMS';
$lang->ncenterlite_push_before_sms_about = 'Don\'t send SMS if the recipient has at least one device to which a push notification has been successfully sent.';
$lang->anonymous_voter = 'anonymous voter';
$lang->about_anonymous_voter = 'anonymize voter in vote notification';
$lang->anonymous_scrap = 'anonymous scrap';

View file

@ -145,8 +145,10 @@ $lang->member_menu_view = '회원 메뉴 표시';
$lang->member_menu_on = '표시';
$lang->member_menu_off = '표시하지 않음';
$lang->about_member_menu_view = '각 회원이 알림 설정을 변경할 수 있는 메뉴를 추가합니다.';
$lang->user_notify_setting = '회원알림설정';
$lang->user_notify_setting = '회원 알림 설정';
$lang->about_user_notify_setting = '각 맴버회원들의 알림을 설정할 수 있습니다. 회원들이 알림을 받지 않도록 설정되어 있다면 해당 회원이 알림센터를 통해서 알림을 못받을 수 있습니다.';
$lang->ncenterlite_push_before_sms = '푸시 성공시 문자 미발송';
$lang->ncenterlite_push_before_sms_about = '1개 이상의 기기로 푸시 알림을 발송하는 데 성공한 경우, 해당 회원에게는 문자를 발송하지 않습니다.';
$lang->ncenterlite_no_notify = '알림 내역이 없습니다.';
$lang->ncenterlite_all_delete = '전체 삭제';
$lang->ncenterlite_month_before_delete = '한 달 이전의 알림 삭제';

View file

@ -24,6 +24,7 @@ class ncenterliteAdminController extends ncenterlite
'colorset',
'zindex',
'anonymous_name',
'push_before_sms',
'document_read',
'layout_srl',
'mlayout_srl',

View file

@ -1331,7 +1331,7 @@ class ncenterliteController extends ncenterlite
function _insertNotify($args, $anonymous = FALSE)
{
$config = getModel('ncenterlite')->getConfig();
$config = NcenterliteModel::getConfig();
if(is_array($config->hide_module_srls) && in_array($args->module_srl, $config->hide_module_srls))
{
@ -1411,8 +1411,11 @@ class ncenterliteController extends ncenterlite
if($output->toBool())
{
ModuleHandler::triggerCall('ncenterlite._insertNotify', 'after', $args);
$this->sendPushMessage($args);
$this->sendSmsMessage($args);
$push_success = $this->sendPushMessage($args);
if (!$push_success || !isset($config->push_before_sms) || $config->push_before_sms !== 'Y')
{
$this->sendSmsMessage($args);
}
$this->sendMailMessage($args);
$this->removeFlagFile($args->member_srl);
}
@ -1601,7 +1604,9 @@ class ncenterliteController extends ncenterlite
$oPush->setData($args->extra_data);
$oPush->setURL(strval($target_url));
$oPush->addTo(intval($args->member_srl));
$oPush->send();
$output = $oPush->send();
return $output;
}
function sendSmsMessage($args)

View file

@ -75,6 +75,14 @@
<p class="x_help-block">{$lang->about_user_notify_setting}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->ncenterlite_push_before_sms}</label>
<div class="x_controls">
<label class="x_inline"><input type="radio" name="push_before_sms" value="Y" checked="checked"|cond="$config->push_before_sms == 'Y'" /> {$lang->use}</label>
<label class="x_inline"><input type="radio" name="push_before_sms" value="N" checked="checked"|cond="$config->push_before_sms != 'Y'" /> {$lang->notuse}</label>
<p class="x_help-block">{$lang->ncenterlite_push_before_sms_about}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->ncenterlite_document_event_read}</label>
<div class="x_controls">