Contains data about an email destination.
| 23 | |
| 24 | # snippet-start:[python.example_code.ses.SesDestination] |
| 25 | class SesDestination: |
| 26 | """Contains data about an email destination.""" |
| 27 | |
| 28 | def __init__(self, tos, ccs=None, bccs=None): |
| 29 | """ |
| 30 | :param tos: The list of recipients on the 'To:' line. |
| 31 | :param ccs: The list of recipients on the 'CC:' line. |
| 32 | :param bccs: The list of recipients on the 'BCC:' line. |
| 33 | """ |
| 34 | self.tos = tos |
| 35 | self.ccs = ccs |
| 36 | self.bccs = bccs |
| 37 | |
| 38 | def to_service_format(self): |
| 39 | """ |
| 40 | :return: The destination data in the format expected by Amazon SES. |
| 41 | """ |
| 42 | svc_format = {"ToAddresses": self.tos} |
| 43 | if self.ccs is not None: |
| 44 | svc_format["CcAddresses"] = self.ccs |
| 45 | if self.bccs is not None: |
| 46 | svc_format["BccAddresses"] = self.bccs |
| 47 | return svc_format |
| 48 | |
| 49 | |
| 50 | # snippet-end:[python.example_code.ses.SesDestination] |
no outgoing calls