Get uploaded attachment by attachment id - Facebook Messenger Bot - facebook-messenger

I try to send a message with attachment id but the attachment doesn't show up, so I want to check it's existed or not. Is there any facebook api to do that?
More detail:
I created a qr image by google chart url like this
https://chart.googleapis.com/chart?chs=300x300&cht=qr&choe=UTF-8&chl=QRCODE
Then upload it to facebook and store attachment id on my database to reuse. I still got an attachment id after uploading but when send it to facebook messenger it doesn't show up.
I think the problem is that facebook doesn't recognize the above url is an image url.

Currently, the only way to do this is to send a message with the attachment_id. I think the issues may be that you are pointing to a dynamically generated image. The Attachment Upload API needs to be pointed to an actual file, though it is strange you are still receiving an attachment ID. One other thing to note is that attachment ID is not supported in any of the template.

I just double checked my codes, the problem is wrong recipient id not the image url. Sorry for the wrong question.

Related

how to download attachments from opportunity in salesforce using rest api

I'm trying to get the attachments that are placed inside a opportunity but I can't doing simple way.
I'm checking the api services/data/v20.0/sobjects/Opportunity/{id} but parent_id is not returning or something that relates to attachments. enter image description here
I would like to know if you have another solution instead of creating a new endpoint
link https://developer.salesforce.com/forums/?id=9062I000000XnlFQAS,

Mail sent with sp_send_dbmail shows embedded images as attachments

I'm using sp_send_dbmail to send a "welcome" email to employees' newly provisioned mailboxes. The content looks good in both Outlook 2016 and in Office365.
There is a difference from the source email I'm replicating, however, in the how the attachments appear. The source email does not show a paperclip icon or attachments in either system. The email sent with sp_send_dbmail shows the paperclip in both and lists attachments in Office365 (but not in Outlook).
I copied the HTML from the source email in Outlook and had to change the src tags to get it to work:
<img ... src="cid:image009.png#01D42E2D.8043A5B0">
This wouldn't show the images until I removed the #01D42E2D.8043A5B0. I haven't been able to find any explanation of what that part of the tag does or how to use it properly.
Is there a way to make the message sent with sp_send_dbmail appear exactly as the original does?
Edit to add:
Further testing finds that TypeApp (an Android mail client) doesn't render the images from sp_send_dbmail, but it does display the source email correctly.
I realize that email clients won't behave consistently, but why can't I make the email I send behave like the other?
A possible workaround is to use SendGrid email. It might work differently with embedded images. Not sure.
In a previous project I hit a lot of various problems with our internal Exchange server, so I just went outside to SendGrid, which worked very well. They have a free tier.

Open Gmail Client With File Already Attached

I see you can send emails with uploaded attachments using the Google Gmail API. However, I want the user to be able to preview the email before sending. It looks like there isn't a way to do this?
So essentially would the only solution be to create my own simple email client, then send the email through the API? Or would using the API even be necessary as in that case I could just use the server's native sendmail client to sent out the email with the user's gmail address as the return address.
I guess using the API, the advantage is the email would appear in the user's SENT folder.
Unfortunately, I don't think there's a live preview that's available in a way you intended. As far as I know, Outlook (for reference) doesn't even have it. What they have is to upload the attachments while the mail is still being drafted.
The best I can think of is once the message will be sent, save it as draft at first and retrieve the mail again on the succeeding page. This will look like a preview that you intended. Once done, you can then finally send the drafted email to the receipients.

Manipulate the content of an email with gmail add on

Hi I am trying to develop a plugin for gmail that will read emails and manipulate the content of the email when it is read within gmail.
More specifically I want to change certain words within the email message.
I've already developed a plugin that can retrieve the email message and manipulate the message as a string but I don't know how to redisplay it.
Is this possible to do? If so which API do I need to use?
I wouldn't have thought you could change the content of an email once in Gmail other than to change labels etc.
One approach that might work would be to manipulate the email in the Gmail UI by using a Browser plug-in such as a Chrome Extension.

Can I use Contact Form DB plugin in my wordpress site for saving and displaying data without sending emails

I want to create a wordpress custom plugin for saving three fields of data and also an image of the same from wp-admin area for every item. It should be able to display all these items in a page.
When I searched for a plugin I found Contact Form DB plugin which can be used as contact form 7 plugin extension for saving data send through it..
http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/
Can I use Contact Form DB plugin in my wordpress site for saving and displaying data without sending emails? It also sends email but I only want to store and display data.
Another problem:- I'm already using a contact form from contact form 7 plugin for sending email enquiries.. Will the changes for saving data in contact form 7 affect its working?
Please help me with any reference or solution as I'm new to wordpress and currently don't know about plugin development.
Any help will be greatly appreciated..
Thanks in advance.
You can use wpcf7_before_send_mail action hook to prevent form being sent to email..
(I have tested this with "Contact Form DB" plugin - it saves data before email is filtered)
To filter only specific Form IDs - use something like this:
function wpcf7_skip_email_sending($wpcf7_data)
{
if ( in_array($wpcf7_data->id(), array(2,3,7)) ) {
$wpcf7_data->skip_mail = true;
}
}
add_action("wpcf7_before_send_mail", "wpcf7_skip_email_sending");
(For older CF7 version you might have to change $wpcf7_data->id() to $wpcf7_data->id)
If you setup the Contact form 7 and put in a junk or noreply email address to send the message to on Contact form 7 it will still log the message being sent in the contact form DB
So in the shortcode template send message to junk#yourdomain.com and whenever a user submits it will try to send to that email and will still log the email as being sent. Personally I would actually create that email address so that your smtp doesn't get flooded with bounce back from smtp server.
To avoid sending emails, without even touching the files, the fastest way is to add in the additional settings tab
demo_mode: on
or
skip_mail: on
With Contact Form DB both works fine. The difference is that demo_mode won't work with Flamingo.

Resources