Issue with attachment in Email API
i am trying to send emails with attachment from email API
attachment picked successfully but file got courrepted
i have tested with word, pdf , txt file. all are receiving as a corrupted files,
here is the code i am using for txt
{ "to": ["[email protected]" ], "from":"company[email protected]", "sender": "company", "subject": "Email API Test", "plain_body": "hello this email api checking", "attachments": [{ "name": "docs.txt", "content_type": "text/plain", "data": "base64_encode($data)", "content_url": "https://www.xyz.com/wp-content/uploads/2023/03/docs.txt" }] }
for docx { "to": ["[email protected]" ], "from":"company[email protected]", "sender": "company", "subject": "Email API Test", "plain_body": "hello this email api checking", "attachments": [{ "name": "123.docx", "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "data": "base64_encode($data)", "content_url": "http://domain.com/images/article/123.docx" }] }
is there anything which i am missing ?
duplicate of #2375