I am using the Twillio Ruby gem to send sms within my application. When building my message body I have been and am using the rails 'url_helpers' to build my links like so:
message += " #{Rails.application.routes.url_helpers.vendor_auction_url(#auction)}"
I have no issue there. What I am not sure of is if I can customize the text for the link similar to an html link such as:
<%= link_to 'HERE', appointment_url(#appointment) %>
I know I can't use that same erb/html syntax. Just hoping to accomplish the same effect in a different way.
Unfortunately, you cannot use html tags in sms / text messages. All you can do is insert the URL without the tag. It then depends on the receivers device whether the URL is presented to the user as link or as plain text. Also referenced here:
create hyperlink in sms in iPhone
Related
We have invite a friend page that uses the following format:
www.example.com/invite-friend?name=name&friend=friend&discount=number
The params are important for us to personalise the page. For best practices we use canonical tags that point to the url without params with the following:
<link rel="canonical" href={`https://www.example.com${pathnameWithoutSlash}`} />
However this is where apple phones using ios messes things up. When the user chooses to copy and send the link ios uses the url the canonical provides, erasing all the params. This becomes a problem for our invite a friend feature.
What would be the best practice to solve this issue on ios?
Should we create canonicals with params or is there way to force ios to pick up on the actual link with a different meta tag?
I am trying to prefill a twitter post using http://twitter.com/?status=
The problem I have is that I would like to include a link in the message that will be display as a clickable link rather than just text.
My approach below doesn't work:
Share on Twitter
Is there any way to achieve this?
You need to use URL encoding - https://en.wikipedia.org/wiki/Percent-encoding - and you don't need to add an HTML <a href....
For example
http://twitter.com/?status=Click%20here%20https%3A%2F%2Fexample.com%2F
You cannot change how the link displays.
I'm sending html emails using premailer. By default, it will generate a simple text rendering of the email based on the non-html content. It's an okay start, but has some annoyances such as literal rendering of all breaks.
Is there a way for me to have a little more control over the text rendering of the email, either with premailer or another tool?
You may want to check out MarkerB
It lets you write your mailer template in Markdown, and it auto-makes html and text versions of your email for sending as multipart mime.
I would like to be able to intercept a hyperlink from an email on BlackBerry.
e.g.
dummy site
I have been able to intercept and identify text in a plain text email using PatternRepository. However, it doesn't seem to work with HTML emails - is this even possible?
I would like to avoid the solution of scanning every incoming email myself, and parsing all the text, but this might be the only option.
Thanks
This is not possible (up to and including BlackBerry 6 afaik). It is not related to the hyperlink concept - it is not possible to use PatternRepository with any type of text within HTML text.
For performance reasons, the BlackBerry designers decided not to implement pattern matching within HTML fields (browser, or email). This is very unfortunate, but it must be dealt with.
In my app, I had the freedom to define the contents of the email. In my case, I ended up including the pattern into the subject of the email - the user can click on the subject to get to my app.
In most other situations, I think the best/only way forward is to intercept each mail as it arrives and parse it looking for the text. If I have to do that in the future, I'll try to update this post with some sample code.
There are various posts on the BlackBerry forums about this issue.
Richard
Is it possible to open a Twitter dialog page to send direct messages, in the same way that one can share something on Twitter by launching this url:
http://www.twitter.com/share/?text=hello+this+is+a+test+message&url=
I would like to avoid having to use the Twitter API (with api key) if possible for this project, but after searching around I'm getting the feeling I have no choice.
Thanks!
There are a couple of ways to accomplish this.
Create an empty official DM dialog. It does not appear to support pre filling with text:
https://twitter.com/#!/direct_messages/create/twitter
Load the full Twitter homepage with pre filled text. Uses the sms shorthand for sending a DM:
https://twitter.com/home?status=d+twitter+msg+goes+here
Load the new Intent interface with pre filled text using the SMS shorthand:
https://twitter.com/intent/tweet/complete?text=d+twitter+msg+goes+here
<a rel="nofollow" target="_blank" href="#" onclick="window.open('http://twitter.com/intent/tweet?text=your_text&url=your_url','tweet','height=300,width=550,resizable=1');return false;">tweet this</a>
Will bring up a tweet dialogue with specified your_text and your_url.
I'm not sure of a URL to use, but there are sites that provide the service like http://twitterdmer.com/ and http://www.socialoomph.com/
Twitter's interface allows for sending direct messages by using either of these formats:
D <username> <text>
M <username> <text>
Read more: https://dev.twitter.com/docs/faq#6521