Can I embed a twitter feed in my email? - email

I'm about to send out an email campaign to my clients. The email will be sent in HTML format, and I wanted to embed a twitter feed in my email, similar to the twitter widgets you see embedded in blogs and websites everywhere. When I copy and paste the code generated through the twitter website, my email doesn't render anything :(
Any ideas if this is possible? Thanks! Here's the code twitter generated:
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'faves',
rpp: 5,
interval: 6000,
title: 'The best of Twitter according to',
subject: 'My Tweets',
width: 250,
height: 300,
theme: {
shell: {
background: '#8540c2',
color: '#ffffff'
},
tweets: {
background: '#ffffff',
color: '#444444',
links: '#43c43f'
}
},
features: {
scrollbar: true,
loop: false,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'all'
}
}).render().setUser('maryamKE').start();
</script>

There is no standard for HTML email, and most email clients sensibly reject JavaScript. I recommend you link to a page on your web site.

There is no good way to accomplish this with the embeds provided directly from Twitter.
This was a need I also had and created a service that makes it extremely easy: https://www.widgmail.com/

Related

ShareThis: the subject shows up in the To field of an email client for the email share button

I am supporting a website that uses ShareThis. I notice that the email share is not configured properly. If one clicks on the email button, the following
&subject=I'd like to share a link with you
shows up in the "To" field of the mail client such as desktop Outlook. How can to fix this? The following is the ShareThis code the site uses:
window.__sharethis__.load('inline-share-buttons', {
alignment: 'right',
id: 'share-buttons',
enabled: true,
font_size: 12,
padding: 3,
radius: 2,
networks: ['facebook', 'twitter', 'reddit', 'email', 'sharethis'],
size: 18,
show_mobile_buttons: true,
spacing: 4
});
There isn't a built-in way with the ShareThis API to correct this issue but you can work around it by handling the share this onLoad event and intercepting the email button click event. I'm using jQuery but it's easy enough to accomplish the same thing with vanilla JS.
window.__sharethis__.load('inline-share-buttons', {
alignment: 'right',
id: 'share-buttons',
enabled: true,
font_size: 12,
padding: 3,
radius: 2,
networks: ['facebook', 'twitter', 'reddit', 'email', 'sharethis'],
size: 18,
show_mobile_buttons: true,
spacing: 4,
onLoad: function () {
//override the default email sharing functionality since it's broken in outlook
$('.st-btn[data-network=email]').on('click', function (e) {
var subject = "I'd like to share a link with you";
var body = $('#share-buttons').data('url');
document.location = "mailto:?subject=" + subject + "&body=" + body;
//Prevent default share this functionality
e.stopPropagation();
});
}
});

tinymce.ui simple text component

I'm using tinymce a trying to extend a plugin to show a dialog with specific layout:
editor.windowManager.open({
title: 'Title of my dialog',
body: [
{type: 'label', text: 'my label'},
{ name:'my_input', type: 'textbox'},
// { type: 'text', html:'some content with <b>bold</b> if posilbe!'},
// { type: 'html', value:'<div>with custom formating</div>'}
]
}
I checked the the documentation for tinymce.ui several times but can find a way to add html or text component in the constructor of the dialog (like the comment rows in the example).
I know there is a option using a ready html template for the dialog.. but there are also a lot of events and triggers so using the constructor and .ui components is more suitable for my case.
I used to use JQuery UI dialog for this but ran into some issues after TinyMCE 4.0.
I have a TinyMCE plugin that lets people fetch the plain text version of their post in the WordPress editor. Then I show them that text using this:
var plain_block = {
type: 'container',
html: '<textarea style="margin: 10px; width: 550px !important; height: 450px !important; background-color: #eee;" readonly="readonly">Whatever plain text I need to show goes here</textarea>'
};
ed.windowManager.open({
title: "Plain Text of This Post",
spacing: 10,
padding: 10,
items: [
plain_block
],
buttons: [
{
text: "Close",
onclick: function() { ed.windowManager.close();}
}
]
});
End result is a pretty plain-jane dialog box with some HTML and a Close button

facebook api with private message multiple to (friends)

I development facebook private message for invite with facebook api.
<script>
FB.init({ appId: 'xxxxxxxxxx', xfbml: true, cookie: true });
FB.ui({
method: 'send',
to: ['1736383768','590528674'],
// picture: 'http://thinkdiff.net/iphone/lucky7_ios.jpg',
//Can be page, popup, iframe, or touch.
display: 'popup',
name: 'yyyyyy',
link: '<%=Request.QueryString["link"]%>'
});
</script>
but adds only the first mate.
how to multiple friends send private message ?
var publish =
{
method: 'stream.publish',
message: 'Some kind of test',
uid: uid,
attachment: {
name: 'Test',
caption: 'Facebook API Test',
description: ('Sure hope it worked!'),
href: 'http://www.test.com/',
media: [
{
type: 'image',
href: 'http://test.com/',
src: 'http://test.com/image.jpg'
}
]
},
action_links: [
{ text: 'Your text', href: 'http://www.test.com/' }
],
user_prompt_message: 'Share your thoughts about test'
};
publish.target_id = friendID;
FB.ui(publish);
publish.target_id = friendID;
FB.ui(publish);
return false;
You should not use stream.publish.
As said by facebook : "We are in the process of deprecating the REST API, so if you are building a new application you shouldn't use this function. Instead use the Graph API and POST a Post object to the feed connection of the User object"
So, now you have the send and feed methods left.
You cannot fill the send method with more than one user id (you can only if you are whitelisted by facebook, but I'm not quite sur how to do this , I would not count on it either).
You can use the feed method to post on many user's friends wall with something like this
FB.api('/USERID/feed', 'post', {
name:postName,
link:postLink,
picture:postPicture,
description:postDescription,
message:postMessage
}, function (postResponse) { //DO SOMETHING HERE });
But doing it, you are taking the risk of your app being deleted by facebook if someone flag it as spam.
As far as I know, sending messages to multiple friends via an App is considered bad/spam by facebook so they do not allow this anymore.
You still can Invite as many friends as you want via the App request dialog (method apprequests) but I'm not sure this is what you want.

action links text in facebook post to wall dialog using javascript not working

I trying to bulid a facebook application using javascript.In my application, the user gets the result and a dialog after a time delay popup. Everthing is working well except one here's my code for the 'post to wall dialog'
<script>
var publish = {
method: 'stream.publish',
display: 'popup', // force popup mode
attachment: {
name: 'Connect',
caption: 'The Facebook Connect JavaScript SDK',
actions: [{ name: 'action_links text!', link: 'http://www.example.com' }],
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'
),
href: 'http://www.example.com/'
}
};
FB.ui(publish, Log.info.bind('stream.publish callback'));
</script>
The line containing actions not working for me.Can anyone just inform what is the solution for this...
The property should be called action_links not actions and only have text and href values. Use something like:
action_links: [{ text: 'action link test', href: 'http://example.com'}]
Note that the action must be defined through the fb web interface for the app!

Use of FB.ui with method permissions.request opens popup

I am working on a Facebook IFrame app and using FB.ui to display the permissions request dialog using the JS SDK.
Here is the code I`m using:
FB.ui(
{
method: 'stream.publish',
message: '',
attachment: {
name: 'תחרות התחפושות הגדולה של לגדול',
caption: '',
media: [{ 'type': 'image', 'src': 'http://www.p-art.co.il/ligdol_purim/logo.gif', 'href': 'http://apps.facebook.com/ligdolpurim/', 'width': '101', 'height': '84'}],
description: ('פורים 2011'),
href: 'http://apps.facebook.com/ligdolpurim/'
},
action_links: [
{ text: 'Ligdol Purim', href: 'http://apps.facebook.com/ligdolpurim/' }
],
user_prompt_message: 'פרסם את השתתפותך בתחרות'
},
function(response) {
alert(response.post_id);
});
}
A happy surprise is that the SDK knows to show the dialog only for the missing permissions (if any). The problem is that a new IE window pops up and then disappears before the dialog is shown inside an iframe.
I have tried several variations on this code I found all over the net and all of them give me this popup before showing the dialog.
I had not considered that in order to open a facebook lightbox, you actualy need to be on facebook. I was testing my IFrame outside facebook. When I began testing the app inside a page tab, I got the lightbox. Ya learn something new everyday.