Task #3043
closedImplement new sender for SMS gate via email
100%
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 usersPhone@gateemail.cz
Updated by Roman Kučera over 2 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
Updated by Roman Kučera over 2 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
Updated by Roman Kučera over 2 years ago
Updated by Roman Kučera over 2 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
Updated by Roman Kučera about 2 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.
Updated by Alena Peterová 9 months 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) ...
Updated by Alena Peterová 8 months 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