I am reading this documentation, it says:
The Gmail API allows you to upload file data when creating or updating a draft or when inserting or sending a message.
https://developers.google.com/gmail/api/guides/uploads
I am trying to upload an attachment to use for multiple emails. Emails have different content, but all with same attachment. Can I use the upload methods specified above to upload the attachment just once and then use it in sending multiple emails?
Related
I am attempted to send word, excel and pdf documents to a flask endpoint. But when I check the documents they are not sending the contents. instead empty documents are being received at the end point. Is there a specific way to send documents?
I am just taking the files as they are, storing them in state and then sending as form data to the flask api.
I am currently working on a application with React as frontend and Nodejs as backend.
I am using multer and minIO to store the files.
Currently:
I have a form where the user fills up some data and also has the option to upload files such as PDF/JPEG etc (multiple input fields for file).
I am using forkmik along with material UI for validation and styling.
So when a user fills up the form (data is a json object), if there is any file upload done it does a POST request to "/upload" uploads the file to the storage engine and then returns a path of where the file is stored.
Then I send one more POST request to "/" to save the user info along with the path that it returned earlier onto MongoDB.
I trying to make it as a single post request to "/" but cannot do so, this is what I have tried,
is to send the user info with content-type "multipart/form-data" along with the files, I am only able to get the "req.files" array properly while the "req.body" of the user information is shown as "[Object: null prototype] { 'values.general_information.first_name': 'Amy',
'values.general_information.last_name': 'John' }" and so on.
I am trying to receive it in a proper json format but cannot do so.
Since the data I was receiving was [Object: null prototype], in the body converted to string using JSON.stringify() and on the backend parsed the incoming data using JSON.parse(), without using react FormData and was able to make it into a single POST request using multipart/form-data as I was uploading files as well.
I am using:
React as front end,
.net core as back end.
I have s3 bucket
Purpose: upload file to S3
allow the users to upload directly via browser ( can be via was sdk or HTTP post)
What I want to achieve:
because of the s3 key, I don't want to give the key to one user, otherwise, one user can upload and read other users file.
I don't want to pass the file to the server, then upload via server.
What's the best way for me to control this? getting a unique key via the my backend server for a particular user?
Or any suggested link/training I can go to?
You can generate an S3 presigned POST URL in the backend using the secret access keys of an appropriate IAM user (let's call it User A). Then return this presigned POST URL to the client, and now client can use this presigned POST URL upload files to S3 bucket on behalf of User A. Here is the documentation which describes how to POST an object to S3 in detail.
I am setting up a bulk emailing solution combining Logic Apps and SendGrid.
User sends email to a mailbox with attachment of required recipients > Logic App reads email > LA resends 'Body' via SendGrid for each recipient.
This works fine with a plain email. However, when an image is embedded within the body Outlook uses Content-IDs.
Currently the body of the email just says a broken image symbol.
How can the images be kept for the re-sending on?
enter image description here
If you want to implement it directly, it could be done. Because if you try to get the mail body you will find it's like below picture.
The body is escaped mail content and the image content is the contentBytes under attachments it's a base64 code.
So if you want to send a image from another mail you have to get the base64 code embed it to your mail. I use the outlook trigger to test it and send with sendgrid, the content will be like this code.
This is test email <br>\n<img src=\"data:image/jpeg;base64,#{triggerBody()['attachments'][0]['contentBytes']}\">
I test this way could send the image, and it could be seen in the mail. If this is not what you want please let know.
I'm looking for implementation for parsing Json object to csv and send it to a custom email address with the csv file as attachment.
Currently I'm using ionic + Mailgun for sending emails without attachments, but Mailgun dosen't support sending files.
many thanks in advance.
There is no real shortcut here. You'll need to iterate over your data set, generate the csv string and then write to file using cordova file plugin. Then you can either prompt the user to send the email by using the plugin cordova-plugin-email-composer to attach the file you've just saved OR find a service that lets you POST a file as part of the request, or write your own backend code to receive POST requests with the file to send the emails.