Retreiving the URL http://www.google.com/reader/api/0/token returns a token, which is periodically updated. What's required to generate this token? Apparently, and I'm guessing a, or some, cookies are accessed by Google for authentication.
Here are my results so far:
thufir#ARRAKIS:~/projects/curl$
thufir#ARRAKIS:~/projects/curl$ ruby token.rb
<html><head><title>403 Forbidden</title>
<style type="text/css">
body {font-family: arial,sans-serif}
div.nav {margin-top: 1ex}
div.nav A {font-size: 10pt; font-family: arial,sans-serif}
span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold}
div.nav A,span.big {font-size: 12pt; color: #0000cc}
div.nav A {font-size: 10pt; color: black}
A.l:link {color: #6f6f6f}
</style></head>
<body text="#000000" bgcolor="#ffffff"><table border="0" cellpadding="2" cellspacing="0" width="100%"></table>
<table><tr><td rowspan="3" width="1%"><b><font face="times" color="#0039b6" size="10">G</font><font face="times" color="#c41200" size="10">o</font><font face="times" color="#f3c518" size="10">o</font><font face="times" color="#0039b6" size="10">g</font><font face="times" color="#30a72f" size="10">l</font><font face="times" color="#c41200" size="10">e</font> </b></td>
<td> </td></tr>
<tr><td bgcolor="#3366cc"><font face="arial,sans-serif" color="#ffffff"><b>Error</b></font></td></tr>
<tr><td> </td></tr></table>
<blockquote><h1>Forbidden</h1>
Your client does not have permission to get URL <code>/reader/api/0/token</code> from this server.
<p></p></blockquote>
<table width="100%" cellpadding="0" cellspacing="0"><tr><td bgcolor="#3366cc"><img alt="" width="1" height="4"></td></tr></table></body></html>
thufir#ARRAKIS:~/projects/curl$
thufir#ARRAKIS:~/projects/curl$ nl token.rb
1 require 'rubygems'
2 require 'curb'
3 token_url = "http://www.google.com/reader/api/0/token"
4 c = Curl::Easy.perform(token_url)
5 puts c.body_str
thufir#ARRAKIS:~/projects/curl$
Take a look at the Google Reader API Auth outlined here. ClientLogin is the simpler approach, but OAuth is probably the more robust solution if you want to deploy it for multiple users. Also using OAuth will save you the trouble of dealing with Google user credentials which should be treated carefully.
Related
I noticed apple mail 13 (exactly mine Version 13.0 (3608.40.2.2.4)) start push images what size are as big as email itself to left. Some time back it could be solved with align="center" like this:
<tr>
<td algin="center">
<img src="something.jpg" alt="" width="600" style="width: 600px; max-width: 100%; height: auto;"/>
</td>
</tr>
but now its no longer working and its make this:
I tried body padding 0 and < meta name="x-apple-disable-message-reformatting"/> but without succes.
Does anybody know how to center that to middle? It is just on apple mail, other clients are fine.
For what it's worth, the align=center fix just made it work for me.
I'm trying to create .oft template for outlook 2010 with a text over an image - text should be customisable by the end users...
If I create new e-mail from a html file and save it as template, input is not editable (using just a normal styled paragraph)
If I create new e-mail template directly in outlook, everything is ok for users, but it doesn't send it properly - everything is send as an attachment - so it doesn't display it properly in some mail clients (e.g. gmail).
Is there any bullet proof way how to create e-mail templates for outlook 2010 ?
I made a Fiddle so you can see this code in action: https://jsfiddle.net/wallyglenn/7zLaLrfx/
<div style="background-color:#ff0000; width:600px;">
<!--[if gte mso 9]>
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
<v:fill type="tile" src="http://www.gwally.com/news/photos/catintinfoilhat.jpg" color="#ff0000"/>
</v:background>
<![endif]-->
<table height="450" width="600" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top" align="left" background="http://www.gwally.com/news/photos/catintinfoilhat.jpg">
<h1 style="text-align: center; color: #ffffff;-webkit-text-stroke-width: 1px; -webkit-text-stroke-color: black; font-family: Arial, san-serif;">
Background Image with text on top
</h1>
</td>
</tr>
</table>
</div>
The original code was taken from https://backgrounds.cm.
Good luck.
I am making HTML Emailer.
The issue i am facing is that , when i see the output of my code in Outlook, then
Register Online text gets down in the outlook.
like Register in one line and Online in new line.
<table cellspacing="0" cellpadding="0" border="0" style=";border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt; background: transparent;">
<tbody><tr>
<td valign="middle" height="40" align="center" class="main-bg-color" style=" background: #ffee00;color: black;display: block;padding-left: 20px;padding-right: 20px;!important; width:100px; cursor: pointer;">
<div class="modtxt"><span class="wrap_textbox"><a style="color: black;text-align: center; display:block; text-decoration: none;-webkit-text-size-adjust: none;font-size: 10px;line-height: 40px;text-transform:uppercase;font-family: \'proxima_novasemibold\', Arial, sans-serif;" href="http://www.hubilo.com/widget/webpanel/login.php?event=c1d1b1dc8d40c37429a8fd1f627c5c5e"><span style="font-weight:100;">Register Online</span></a></span></div>
</td>
</tr>
</tbody></table>
How can I solve it?
Thank You.
I'm not entirely sure what you want to do, but if it's make sure that "register online" doesn't ever break onto two lines, then the easy solution for Outlook is to use a non-breaking space character ( ) rather than a space.
REGISTER ONLINE
This should solve that particular issue.
I have create a email template for a custom module.
For that case it have using core/email_template_mailer ( Mage::getModel('core/email_template_mailer');) and also it has html template .But it is not working;
Here define template html in config.xml
<template>
<email>
<vendor_create_account_email_template translate="label" module="vendor">
<label>New account</label>
<file>vendor_account_new.html</file>
<type>html</type>
</vendor_create_account_email_template>
</email>
</template>
favorite
i have create a email template for a custom module.
For that case it have using core/email_template_mailer ( Mage::getModel('core/email_template_mailer');) and also it has html template .But it is not working;
Here define template html in config.xml
New account
vendor_account_new.html
html
And Mail send code is
$vednor=Mage::getModel('vendor/vendor')->load(66);
/** #var $mailer Mage_Core_Model_Email_Template_Mailer */
$mailer = Mage::getModel('core/email_template_mailer');
$emailInfo = Mage::getModel('core/email_info');
$emailInfo->addTo($vednor->getEmail(), $vednor->getName());
$mailer->addEmailInfo($emailInfo);
// Set all required params and send emails
$mailer->setSender('amit#gmail.com');
$mailer->setStoreId(1);
$mailer->setTemplateId('vendor_create_account_email_template');
$mailer->setTemplateParams(array('vendor' => $vednor));
$mailer->send();
And code in vendor_account_new.html is
<!--#subject Welcome, {{var vendor.name}}! #-->
<!--#vars
{"store url=\"\"":"Store Url",
"var logo_url":"Email Logo Image Url",
"htmlescape var=vendor.name":"Customer Name",
"store url=\"customer/account/\"":"Customer Account Url",
"var vendor.email":"Customer Email",
"htmlescape var=$customer.password":"Customer Password"}
#-->
<!--#styles
body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
#-->
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
<tr>
<td align="center" valign="top" style="padding:20px 0 20px 0">
<!-- [ header starts here] -->
<table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
<tr>
<td valign="top">
<img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></td>
</tr>
<!-- [ middle starts here] -->
<tr>
<td valign="top">
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Dear {{htmlescape var=$vendor.name}},</h1>
<p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">Welcome to {{var store.getFrontendName()}}. To log in when visiting our site just click Login or My Account at the top of every page, and then enter your e-mail address and password.</p>
<p style="border:1px solid #E0E0E0; font-size:12px; line-height:16px; margin:0; padding:13px 18px; background:#f9f9f9;">
Use the following values when prompted to log in:<br/>
<strong>E-mail</strong>: {{var vendor.email}}<br/>
<strong>Password</strong>: {{htmlescape var=$vendor.password}}<p>
<p style="font-size:12px; line-height:16px; margin:0 0 8px 0;">When you log in to your account, you will be able to do the following:</p>
<ul style="font-size:12px; line-height:16px; margin:0 0 16px 0; padding:0;">
<li style="list-style:none inside; padding:0 0 0 10px;">– Proceed through checkout faster when making a purchase</li>
<li style="list-style:none inside; padding:0 0 0 10px;">– Check the status of orders</li>
<li style="list-style:none inside; padding:0 0 0 10px;">– View past orders</li>
<li style="list-style:none inside; padding:0 0 0 10px;">– Make changes to your account information</li>
<li style="list-style:none inside; padding:0 0 0 10px;">– Change your password</li>
<li style="list-style:none inside; padding:0 0 0 10px;">– Store alternative addresses (for shipping to multiple family members and friends!)</li>
</ul>
<p style="font-size:12px; line-height:16px; margin:0;">If you have any questions about your account or any other matter, please feel free to contact us at {{config path='trans_email/ident_support/email'}} or by phone at {{config path='general/store_information/phone'}}.</p>
</td>
</tr>
<tr>
<td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
Can any one tell me,what are the issue...
use this..
for config.xml
<template>
<email>
<custom_payment module="paymentlink">
<label>Payment Link</label>
<file>custom_payment.html</file> <!-- this specifies the path where the custom template is located -->
<type>html</type>
</custom_payment>
</email>
</template>
for controller
try{
//load the custom template to the email
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('custom_payment');
// it depends on the template variables
$emailTemplateVariables = array();
$emailTemplateVariables['order_id'] = $data['order'];
$emailTemplateVariables['logo_url'] = $logo;
$emailTemplateVariables['customer_name'] = $firstname;
$emailTemplateVariables['customer_info'] = $firstname.' '.$lastname;
$emailTemplateVariables['shipment_url'] = $data['link'];
$emailTemplateVariables['store_name'] = Mage::app()->getStore()->getName();
$emailTemplate->setSenderName($senderName);
$emailTemplate->setSenderEmail($senderEmail);
$emailTemplate->setType('html');
$emailTemplate->setTemplateSubject($firstname.' you forgot to choose shipping options for your product');
$emailTemplate->send($data['email'], $firstname . $lastname, $emailTemplateVariables);
$linker = mysql_real_escape_string(base64_encode($data['link'])); //print_r($linker);exit;
$model = Mage::getModel('paymentlink/paymentlink')
->setRelatedOrderid($data['order'])
->setCustEmail($data['email'])
->setPrice($data['price'])
->setReceived(0)
->setLink($linker)
->setLinkId($data['key'])
->save();
Mage::getSingleton('adminhtml/session')->addSuccess("Link has been Generated successfully & Email has been sent ! </br>".$data['link']."");
}
catch (Exception $e) {
$errorMessage = $e->getMessage();
Mage::getSingleton('adminhtml/session')->addError("We cannot send generated link . There must be some error occurs.");
return $errorMessage;
}
After a long fight with code , i have got it solution.Main, issue was the code format and it variable system format.
Here the code And steps:
Step1:Get current store id.
$storeId=Mage::app()->getStore()->getId();
Step2: Sender() parameters should be in array format array('email'=>(string) $senderemail,'name'=> (string)'$sendername);
....
Full code is
$storeId=Mage::app()->getStore()->getId();
$Vendor=Mage::getModel('vendor/vendor')->load(57);
/** #var $mailer Mage_Core_Model_Email_Template_Mailer */
$mailer = Mage::getModel('core/email_template_mailer');
$emailInfo = Mage::getModel('core/email_info');
$emailInfo->addTo((string)$Vendor->getEmail(),(string) $Vendor->getName());
$mailer->addEmailInfo($emailInfo);
// Set all required params and send emails
$mailer->setSender(array('email'=>(string) 'dev.amitbera#gmail.com','name'=> (string)'Bal ta'));
$mailer->setStoreId($storeId);
$mailer->setTemplateId((string) 'vendor_account_create_template');
$mailer->setTemplateParams(array('vendor'=>$Vendor));
$mailer->send();
I have the following two td elements
<TD ALIGN="LEFT" VALIGN="top" WIDTH="150" STYLE="font-size: 11px; font-family: arial" HEIGHT="65"> <B><i>Brand </i></B><BR>Title<BR>
$65.00
</TD>
<TD ALIGN="LEFT" VALIGN="top" WIDTH="35"> </TD><TD ALIGN="LEFT" VALIGN="top" WIDTH="150" STYLE="font-size: 11px; font-family: arial" HEIGHT="65"> <B><i>Brand </i></B><BR>Title<BR>
<span style="color: #999999; font-weight: normal;"><strike>$212.00</strike></span> <B>$127.20</B>
</TD>
I want to retrieve the final price from both ($65.00 and $127.20). I can use
//td/br[last()]/following-sibling::text()[1]|//td/br[last()]/following-sibling::b[1]
to return
[0] =>
$65.00
[1] => Â Â
[2] => $127.20
where [1] is the preceding the second price. Is there an xpath that will retrieve only
[0] =>
$65.00
[1] => $127.20
?
In both cases the text in question is the final non-empty text node descendant. That's how you'd describe it in English; here's how to say it in XPath:
//td/descendant::text()[normalize-space()][last()]
I haven't tried this, but it seems to me that in this particular case,
//td/br[last()]/following-sibling::*[last()]
may work, because both the text node containing $65.00 and the B node containing $127.20 are the last of their siblings.