via Automated Action, server Action, mail template , Is it possible??
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
HI,
If you need to send email when the form submits,
try in your controller where the action is routed
ie form action="/xxx"
try
@http.route("/xxx", auth='public')
def send_mail_on_action_submit(self,**post):
#get the values and perform actions from post
mail_obj.send() or use send_mail() function
Yes Sama it is possible. See the python code
Example
import smtplib
sender = 'username'
receivers = 'destinations'
message = """hai """
smtpObj = smtplib.SMTP(host='smtp.gmail.com', port=587)
smtpObj.ehlo()
smtpObj.starttls()
smtpObj.ehlo()
smtpObj.login(user="username", password="password")
smtpObj.sendmail(sender, receivers, message
print "Successfully sent email
All the best !
thanks, I do not know this method, via the user interface if you can explain to me that, for example,in email template form, How to set our fields(from , to ,..)????
Suppose source is foo@gmail.com and destination is bar@gmail.com
Then
sender = 'foo@gmail.com' # you can use sender = self.field_name
receivers = 'bar@gmail.com'
...
...
smtpObj.login(user="foo@gmail.com", password="password of foo@gmail.com")
...
You can use html template
body = fields.Html('Body')
refer : http://stackoverflow.com/questions/882712/sending-html-email-using-python#answer-882770
You'll find a similar examples in this post: How to send an email after login?
and in this: How to send an email via python with the new API ?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up