ebay ReviceItem - Item description passing HTML (versus plain text) - ebay-api

I've read the API documentation but can't work out what I need to set correctly, if wanting to send the item "description" in html format (vs plain text), this is from the API
"The seller's description of the item. In listing requests, you can submit your description using CDATA if you want to use HTML or XML-reserved characters in the description"
....so by 'enveloping item description HTML with 'CDATA' .... is all the ebay receiving server needs to know that the data beign sent is HTML (i thought there'd be an API attribute I'd need to set to specify that the data I'm sending is HTML?

Related

How to get content from a Notion page with formatting with Integromat (Make.com)?

I am trying to set up Integromat (Make) to retrieve content from a Notion page and use it in an email.
I have been able to set up most of the scenario, but I am stuck on one issue:
How to retrieve content from a Notion page (I am using the list page contents module) with formatting? I’ve been able to retrieve simple text, but not bold and lists etc.

Post html content to an activity with Google + Domains API

I'm triying to post HTML content to an activity with the new google + domains API with no success.
Activity activity = new Activity()
.setObject(new Activity.PlusObject().setContent("First line<br><b>second line</b>"))
.setAccess(acl);
Acording to the documentation with setConent you can specify "The HTML-formatted content, which is suitable for display." but when i try to post some html its get displayed as plain text.
I need to create an activity with some linebreaks and bold text. How can i achieve that?
Thanks in advance.
the content (HTML) field is only meant for output, you are not allowed to write in HTML. You should be writing in plain text (as you do in the browser), newlines are respected with normal line breaks (\n)
This field is useful to display formatted posts that contain links etc..

Rails, emails and html code

When my rails app sends an email to a gmail account with the body as html code dynamically generated, in the email the html code is displayed and the html is not rendered.
my html is dynamically generated something like this:
html = "<html><table> ...... </table></html>"
and the email displays all of that html code
Do i need to add any specific headers or anything?
I would suggest taking a look at the Action Mailer Rails Guide. Sounds like you're only using the mailer part of Action Mailer. You should avoid hand crafting HTML into a variable like that, it's not the Rails-way.
I'd also suggest taking a look at Ryan Bate's screencast on Sending HTML Email.
Try
html.html_safe
to render the text of html as HTML type instead of plain text, or your tags will be html-escaped...

Is it possible to send inline image using email template in openerp?

I have to send an image using email template in OpenERP but I have to insert it just like we have a feature of insert image in gmail,yahoo and have here also in stackoverflow.com.
I have to send image like this is because I want it should be displayed at the same time when mail is open, along with the text.
If I send it using attachments it coems in attachments which we can see just after download the image. I dont need this download option what I need is open image.
thanks in advance !
There are 3 common ways to embed images within an email (in increasing complexity order): using public URLs, using Data URI to inline the image data in the src attribute, and using images attached to the email.
In all 3 cases you can use regular HTML techniques to include them in the HTML/Rich-Text body of the OpenERP email template: for example with an <img src="..."/> tag or the CSS background-image property.
Only the first 2 techniques will work out-of-the-box in OpenERP's email templates.
1. Using hosted images
The image URL can simply be a public URL on your website or any image hosting service on the internet:<img src="http://www.example.com/myimage.png">. This is very similar to what happens when you embed an image on stackoverflow, as the image is first uploaded to imgur.com automatically and the img src attributes refers to the URL of the uploaded image on imgur.com.
This works but nowadays most email clients (thunderbird, gmail, outlook, ...) will block remote images, as they are commonly abused to detect the fact that a given email was opened by its recipient (if the image is downloaded, it means the mail was opened). Typically the recipient will have to click a banner or warning in order to display these remote images.
This is the only technique that works out-of-the-box with OpenERP's email templates.
2. Using Data URI to inline the image data
The src attribute of an img tag can use the Data URI (RFC 2397) scheme to include the image binary source inline. The image tag would look like this:
<img src="data:mime-type;encoding,<encoded_image_data>"/>
For a PNG image, this could look like this
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."/>
You can use this technique for OpenERP email templates, and it does not have the downside of being blocked by email clients. However you will need to manually convert your image to base64[A]. This will also substantially increase the size of your templates and your outgoing emails, and has several limitations (e.g. max 32KB if you want maximum compatibility).
[A]: Google "online base64 file encoder" if you want a simple way to do the conversion
3. Using attached images (not currently supported in OpenERP)
RFC 2111 specifies a way for message body parts to refer to other body parts using cid: URLs. For example the img src attribute within an email can refer to one of the attachments. Technically the img tag could look like this:
<img src="cid:some_unique_content_id/>
where some_unique_content_id is the Content-ID of the message part that contains the image. This is what it will look like in the final (raw) email:
------=_NextPart_WHATEVER_ID
Content-Type: image/jpeg;
name="image.jpg"
Content-Transfer-Encoding: base64
Content-ID: <some_unique_content_id>
Content-Disposition: inline;
filename="image.jpg"
/9j/4AAQ...continuation_of_the_base64_encoded_image
This technique also does not have the downside of being blocked by email clients, but it is more complex to implement because you need to specifically assign a Content-ID to each attachment, and the final email that is sent on the wire is bigger because it must contain the actual images.
This is not currently available in OpenERP, but it would not be very difficult to implement. One trivial way would be to automatically assign sequential Content-ID identifiers to all attachment (e.g. attachment_1, attachment_2) when the final mail is crafted by the email layer, and perhaps add an option in the email template Value Builder assistant to generate cid-based URLs for the attachments.
this maybe useful embedding image in html email
although I don't think this is an openerp-related problem...
Here is how I added the company logo on my Sale Order email template with Odoo 11:
<p>
% set company = object.company_id or ctx.get('company')
% if company.logo:
% set field_value = '%s' % company.logo
% set company_logo_base64 = 'data:image/*;base64,%s' % field_value[2:-1]
% endif
<img t-if="company_logo_base64" src="${company_logo_base64}">
</p>

eBay API: revising html description

I am trying to revise items' html description part (the seller's custom info at the bottom of eBay item page).
I checked GetItem and ReviseItem and couldn't find any of description info.
Actually there is a description field, but it's just a text description of an item.
How do I change the custom HTML part of an item?
Thanks.
Sam
Never mind!
I need to pass DetailLevel => 'ReturnAll' to get the html description.