Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change SMS Sending method to New Option Based Method #5354

Closed
buddhika75 opened this issue May 23, 2024 · 0 comments
Closed

change SMS Sending method to New Option Based Method #5354

buddhika75 opened this issue May 23, 2024 · 0 comments
Assignees

Comments

@buddhika75
Copy link
Member

change SMS Sending method to New Option Based Method

Now sendSmsByApplicationPreference method is replaced with sendSms
Only have to provide SMS as parameter. SMS is saved and received message is assigned inside the new method, so no need to assign status and message separately.

Example 1

Old Method
SmsSentResponse sent = smsManager.sendSmsByApplicationPreference(e.getReceipientNumber(), e.getSendingMessage(), sessionController.getApplicationPreference());
e.setSentSuccessfully(sent.isSentSuccefully());
e.setReceivedMessage(sent.getReceivedMessage());
getSmsFacade().edit(e);

New Method
Boolean sent = smsManager.sendSms(e);
if (sent) {
JsfUtil.addSuccessMessage("SMS Sent");
}else{
JsfUtil.addSuccessMessage("SMS Failed");
}

Example 2
Old Method
SmsSentResponse sent = smsManager.sendSmsByApplicationPreference(e.getReceipientNumber(), e.getSendingMessage(), sessionController.getApplicationPreference());
e.setSentSuccessfully(sent.isSentSuccefully());
e.setReceivedMessage(sent.getReceivedMessage());
getSmsFacade().edit(e);

New Method
Boolean sent = smsManager.sendSms(e);

Example 3
Old Method
SmsSentResponse sentSuccessfully = smsManager.sendSmsByApplicationPreference(e.getReceipientNumber(), e.getSendingMessage(), sessionController.getApplicationPreference());
e.setSentSuccessfully(sentSuccessfully.isSentSuccefully());
e.setReceivedMessage(sentSuccessfully.getReceivedMessage());
e.setSentAt(new Date());
getSmsFacade().edit(e);

New Method
Boolean sentSuccessfully = smsManager.sendSms(e);

buddhika75 added a commit that referenced this issue May 23, 2024
@buddhika75 buddhika75 self-assigned this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant