Pull email sending concerns out into a standalone service
This commit is contained in:
parent
7d535a2c31
commit
c1a61730d5
4 changed files with 46 additions and 57 deletions
|
|
@ -8,11 +8,11 @@ EmailAddress = str
|
|||
|
||||
@dataclass
|
||||
class Email:
|
||||
api_key: str
|
||||
bird_api_key: str
|
||||
sender: EmailAddress
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, config: dict[str, Any]) -> 'Email':
|
||||
assert_key_of_type(config, 'api_key', str)
|
||||
assert_key_of_type(config, 'bird_api_key', str)
|
||||
assert_key_of_type(config, 'sender', str)
|
||||
return Email(api_key=config['api_key'], sender=config['sender'])
|
||||
return Email(bird_api_key=config['bird_api_key'], sender=config['sender'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue