Skicka meddelanden

Introduktion till AWS Boto i Python

Maksim Pecherskiy

Data engineer

Publicera till ett ämne

response = sns.publish(
  TopicArn = 'arn:aws:sns:us-east-1:320333787981:city_alerts',
  Message = 'Body text of SMS or e-mail',
  Subject = 'Subject Line for Email'
)

SNS publicerar till ett ämne

Introduktion till AWS Boto i Python

Publicera till ett ämne

SNS publicerar till ett ämne SNS publicerar till ett ämne

Introduktion till AWS Boto i Python

Publicera till ett ämne

SNS publicerar till ett ämne SNS publicerar till ett ämne

Introduktion till AWS Boto i Python

Skicka anpassade meddelanden

num_of_reports = 137

response = client.publish(
  TopicArn = 'arn:aws:sns:us-east-1:320333787981:city_alerts',
  Message = 'There are {} reports outstanding'.format(num_of_reports),
  Subject = 'Subject Line for Email'
)
Introduktion till AWS Boto i Python

Skicka ett enskilt SMS

response = sns.publish(
  PhoneNumber = '+13121233211',
  Message = 'Body text of SMS or e-mail'
)

Skicka ett enskilt SMS

Introduktion till AWS Boto i Python

Inte lämpligt på lång sikt

  • Engångsmeddelanden = snabbt och enkelt
  • Ämnen och prenumeranter = underhållbarhet
Introduktion till AWS Boto i Python

Publicera till ämne vs. enskilt SMS

Publicera till ett ämne

  • Kräver ett ämne
  • Ämnet måste ha prenumerationer
  • Passar bättre för flera mottagare
  • Enklare listhantering

Publicera till ämne

Skicka ett enskilt SMS

  • Inget ämne behövs
  • Inga prenumerationer behövs
  • Skickar direkt till ett telefonnummer
  • E-postalternativ saknas

Skicka enskilt SMS

Introduktion till AWS Boto i Python

Repetition

Publicera till ett ämne

response = sns.publish(
  TopicArn = 'arn:aws:sns:us-east-1:320333787981:city_alerts',
  Message = 'Body text of SMS or e-mail',
  Subject = 'Subject Line for Email'
)

Skicka ett enskilt SMS

response = sns.publish(
  PhoneNumber = '+13121233211',
  Message = 'Body text of SMS or e-mail'
)
Introduktion till AWS Boto i Python

Nu kör vi en övning!

Introduktion till AWS Boto i Python

Preparing Video For Download...