2016-10-10 32 views
0

那裏如何獲取存儲的郵件內容(不僅是主題)

我遇到了一個問題,如何從mailgun api獲取郵件內容。

我使用mailgun事件API(https://documentation.mailgun.com/user_manual.html#events),我成功地得到事件日誌。

{ 
"items": [ 
{ 
    "tags": [], 
    "timestamp": 1376325780.160809, 
    "envelope": { 
    "sender": "[email protected]", 
    "transport": "" 
    }, 
    "event": "accepted", 
    "campaigns": [], 
    "user-variables": {}, 
    "flags": { 
    "is-authenticated": true, 
    "is-test-mode": false 
    }, 
    "message": { 
    "headers": { 
     "to": "[email protected]", 
     "message-id": "[email protected]", 
     "from": "Excited User <[email protected]>", 
     "subject": "Hello" 
    }, 
    "attachments": [], 
    "recipients": [ 
     "[email protected]" 
    ], 
    "size": 69 
    }, 
    "recipient": "[email protected]", 
    "method": "http" 
} 
], 
"paging": { 
"next": 
    "https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...", 
"previous": 
    "https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm..." 
} 
} 

返回數據,但問題是,事件日誌未包含電子郵件內容(僅須從,到...)。

如何獲取電子郵件內容?

有人能給我一個例子嗎?

謝謝!

回答

1

mailgun Log API不包含電子郵件內容。

要獲取電子郵件內容,您需要註冊一個webhook並按照Retrieving Stored Messages示例進行操作。

您還可以根據此blog post通過Events API獲取消息。

+0

感謝您的回覆。我從這個博客得到了答案。 http://blog.mailgun.com/how-to-view-your-messages/ – timlentse

相關問題