我试图在特定主题中获取下标的电子邮件。
但是下面的代码我得到了一个dictonary,但我只想要电子邮件:
conn = boto.sns.connect_to_region("us-east-1")
test = conn.get_all_subscriptions_by_topic("arn:aws:sns:us-east-2:8274142742:testtopic")
print test
我正在尝试这样的事情:
test2 = test['ListSubscriptionsByTopicResponse']['ListSubscriptionsByTopicResult']['Subscriptions'][0]
但是,我再也没有收到电子邮件。
你知道我怎么才能收到这里的电子邮件?
使用print test
,我得到了这个:
{u'ListSubscriptionsByTopicResponse':
{u'ResponseMetadata': {u'RequestId': u'd0cc4614-c74-580-b87-0abc0354042'},
u'ListSubscriptionsByTopicResult': {u'NextToken': None, u'Subscriptions':
[{u'Owner': u'8472474872', u'Endpoint': u'email@testemail.email', u'Protocol': u'email',
u'TopicArn': u'arn:aws:sns:us-east-2:8274142742:testtopic',
u'SubscriptionArn': u'arn:aws:sns:us-east-2:8274142742:testtopic:764201g4-812-4e26-a234-3ed4c2732d'}]}}}