Skip to content

Why is the implementation of ISmsSender and IEmailSender tied logically to the NotifyVolunteersCommand? #1395

@mgmccarthy

Description

@mgmccarthy

I would expect the ISmsSender/IEmailSender implementation that has nothing to do with a business concept like notifying volunteers.

The API/usage suggests an implementation that would use QueueStorageService directly, but instead, we send the NotifyVolunteersCommand to the NotifyVolunteersCommandHandler, which uses QueueStorageService.

This is confusing as the usage of the API in some cases has nothing to do with "notifying volunteers". For example, SendAccountApprovalEmailHandler uses IEmailSender like this:
image

Here we're sending an account approval email with this message:
"Your account has been approved by an administrator. Please <a href="{message.CallbackUrl}">Click here to Log in"

This has nothing to do with notifying volunteers.

I suggest we change ISmsSender/IEmailSender implementation to use QueuedSmsMessage directly (basically the code in NotifyVolunteersCommandHandler), where appropriate, we can send the NotifyVolunteersCommand and the NotifyVolunteersCommandHandler can take a dependency on
IEmailSender/ISmsSender in order to send that notification to volunteers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions