Project

General

Profile

Actions

Task #3043

closed

Implement new sender for SMS gate via email

Added by Roman Kučera almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Alena Peterová
Target version:
Start date:
01/21/2022
Due date:
% Done:

100%

Estimated time:
Owner:

Description

  • Option to set the sender address
  • Option to set the gate email suffix
  • Subject of email is the SMS body
  • Body of email empty

IdM will send SMS via email SMS gate.
SMS will be send to

Actions #1

Updated by Roman Kučera almost 3 years ago

  • % Done changed from 0 to 50

new config property for email suffix
idm.sec.sms.script.get.sms.email.sender.suffix=@test.cz

Actions #2

Updated by Roman Kučera almost 3 years ago

  • Option to set the sender address = should be possible via standard app config for emailer
  • Subject of email is the SMS body = possible via standard template config
  • Body of email empty = possible via standard template config
Actions #4

Updated by Roman Kučera almost 3 years ago

  • % Done changed from 50 to 70

Fixed bug with duplicated notification.
Added some new condition so the new sms emailer is used only when the new sender is used

Actions #5

Updated by Roman Kučera almost 3 years ago

All is implemented. Only thing is that when sms(email) is send error message in log is shown because email log has no uuid. There is no way how to fix it from the side of module.
Only way how to fix is in product EmailCallback class inside DefaultEmailer and add some check if uuid is null or not.

Actions #6

Updated by Alena Peterová over 1 year ago

Added to the documentation: https://wiki.czechidm.com/tutorial/adm/modules_sms

Tested in the environment of our customer.
When dealing with phone numbers, we have to remove whitespace: https://git.bcvsolutions.eu/modules/sms/-/commit/37594c91b5a510335b9c4b6c41d67d5268377691.
Otherwise, it works fine in our case.
There is a little catch that only prefixes that are removed from phone numbers are Czech 420 and Slovak 421. It would be more universal to remove other prefixes too, or make it a configuration property. However, I think it's enough for now.

Note:
There is only the issue mentioned above #3043#note-5, which currently doesn't have solution. The application log always displays error:

2023-08-18 15:33:15.450 ERROR 510945 --- [Camel (camel-1) thread #0 - ProducerTemplate] e.b.i.c.n.s.impl.DefaultEmailer.onComplete : Unspecified error while save emailLog, with id: [null].
org.springframework.dao.InvalidDataAccessApiUsageException: The given id must not be null!; nested exception is java.lang.IllegalArgumentException: The given id must not be null!
    at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:373)
...

Actions #8

Updated by Peter Štrunc over 1 year ago

  • Assignee changed from Roman Kučera to Alena Peterová
  • % Done changed from 70 to 80

I have found a few issues and added them as comments to PR. Could you check it out @apeterova, please?

Actions #9

Updated by Alena Peterová over 1 year ago

  • Status changed from In Progress to Needs feedback

Thanks for the feedback, I changed both places as you suggested in the commit https://git.bcvsolutions.eu/modules/sms/-/commit/27409c55436b27e210c7b75874d1ae56b2f134dd
Now, the transformation of the phone number is that we take final 9 digits and it's not important which prefixes are used (if any).

Merge request:
https://git.bcvsolutions.eu/modules/sms/-/merge_requests/5

Actions #10

Updated by Ondřej Kopr over 1 year ago

  • Status changed from Needs feedback to Resolved
  • % Done changed from 80 to 100

Module was release in version 2.1.0

Actions #11

Updated by Peter Štrunc about 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF