template

Asked by bousselmi

hi,

I want to know how I can add a picture into a template poweremail
and how I can add a condition.

best regards

Question information

Language:
English Edit question
Status:
Answered
For:
Power Email Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#1

Hi,

Just use html and store the image in a public place.

<img src="Public Location" alt="My signature"/>

or alternative is put binary

<img src="data:image/gif;base64,xxxxxxxxxxxxx...">

In this case image binary can be fetched from open ERP database.

<img src="data:image/gif;base64,${object.company_id.logo}">

Revision history for this message
bousselmi (as-bousselmi) said :
#2

is that you can show me step by adding a picture in the mail template.
is that I can insert an image from hard drive machine that contains the server openerp?
or I should add the image to insert as an attachment Identifícate openerp and use here, and if so how I can use this attachment?

For the model in terms of mail, how can I add a condition:
For example, I want to write if Mr. gender switch is if I write male madam. what is the expression that allows me to use the conditions in my model.

Thank you for answering me
best regards

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#3

Hi bousselmi,

I am not an HTML expert so from the html I know this is what can be done in templates. Either the image can be stored in something like imageshack.us and then you put an img tag in the html to pull up the same image when the client reads the email.

Other option is to directly use the expression of your company logo from res.company and use the binary base64 html tagging on html.

Reg your last question:
This is how you use if
% if x==5:
    this is some output
% endif

so
% if object.sex=='male':
Mr.
% elif object.sex=='female':
Mrs.
% else:

% endif

Revision history for this message
bousselmi (as-bousselmi) said :
#4

thanks for your response

I have another question, I want to know if we can add an attachment to the template other than the report XML defined in openerp.
if yes how can I make the dedication

Thank you

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#5

Not yet,

It would be a nice feature to develop.
But currently not in the roadmap as nobody is there to fund it.

Can you help with this problem?

Provide an answer of your own, or ask bousselmi for more information if necessary.

To post a message you must log in.