Send Email From Code Using Email Template in Odoo

Поделиться
HTML-код
  • Опубликовано: 28 янв 2025

Комментарии • 65

  • @syamaas9621
    @syamaas9621 4 года назад +1

    👌👌👌... Clearly mentioned all... Thank u very much.

    • @OdooMates
      @OdooMates  4 года назад

      Thanks for all the support :)

  • @muhamedabdel-rhman2450
    @muhamedabdel-rhman2450 5 лет назад +3

    @07:23 what if u used
    template_id=self.env.ref(‘ur.template’)
    template_id.send email() instead
    Why use .id then browse the object

    • @OdooMates
      @OdooMates  5 лет назад +1

      Hope you are telling about the code optimizations, What you have told is (y)

    • @muhamedabdel-rhman2450
      @muhamedabdel-rhman2450 5 лет назад +2

      Odoo Mates yes that exactly what i mean

  • @SamirSELLAMI
    @SamirSELLAMI Год назад +1

    Great Tutorial, is there any tutorial on how to send email via a wizard ? I mean load the email template in a wizard to give the possibility to customize it before sending. Thanks

    • @OdooMates
      @OdooMates  Год назад +1

      i think, yet we haven't created this video, sending email using wizard,
      hopefully we can add it under odoo 16 tutorials

    • @SamirSELLAMI
      @SamirSELLAMI Год назад

      @@OdooMates Nice we look forward for that ! I just want to know, I found that the mail module already has mail.message.compose wizard. It is possible to use this wizard directly without coding a new one right?

  • @hectorherrera4193
    @hectorherrera4193 2 года назад +1

    Hello. Thanks for this video. It has helped me a lot

  • @PraveenKumar-qc4ql
    @PraveenKumar-qc4ql 5 лет назад +2

    Hi,
    Thank you for such a good explanation.
    I have a clarification regarding getting email template recordset, I'm asking this to know if there is any specific reason for why you are browsing the ID.
    In the video, you are getting the email template ID and browsing that ID to get recordset and then you are calling send_mail().
    But I just implemented this with a single line as below.
    self.env.ref(module_name.xml_if).send_mail().
    And this is working perfectly, please let me know if my code will fail in any cases, so I will update it quickly with your way.
    Thanks!!!
    Awaiting your reply!

    • @OdooMates
      @OdooMates  5 лет назад +1

      You are right, while making the video we missed it.

    • @PraveenKumar-qc4ql
      @PraveenKumar-qc4ql 5 лет назад +1

      @@OdooMates Thanks for your quick reply! Great!

  • @atchathomas1885
    @atchathomas1885 4 года назад +1

    Hello Odoo mates
    Thank you for your very informative videos
    Can you make us a video showing how to send our module to Odoo Apps to make it available to everyone

    • @OdooMates
      @OdooMates  4 года назад

      Yes we will make one :)

  • @hectorherrera4193
    @hectorherrera4193 2 года назад +1

    Have a question. I have a wizard executed from the menu. It is normally executed afted the user reviewed a tree view. When the wizard end, the initial voew is not updated by the records of the wizard. How can I update the view so the user can see the results of the wizard? Thanks !

    • @OdooMates
      @OdooMates  2 года назад

      from the wizard what operation you currently performs ?

    • @hectorherrera4193
      @hectorherrera4193 2 года назад

      @@OdooMates Hello Good morning. I am using the Attendance app and, my wizard generates all the records for the month, when wizard ends, the previous tree view that shows the attendances, it not refreshed...

    • @OdooMates
      @OdooMates  2 года назад

      @@hectorherrera4193 from the wizard if you are executing some python code, add this to last:
      return {
      'type': 'ir.actions.client',
      'tag': 'reload',
      }

    • @hectorherrera4193
      @hectorherrera4193 2 года назад +1

      @@OdooMates Thank you! worked fine😃

    • @OdooMates
      @OdooMates  2 года назад

      ❤️❤️❤️❤️

  • @albertoreveron4610
    @albertoreveron4610 3 года назад +1

    Excellent!
    template.send_mail for emails.
    What is the attribute to send sms?

    • @OdooMates
      @OdooMates  3 года назад

      in the latest odoo versions ? may be to send message as sms, but for this sms packages has to be buyed using iAP

  • @mohamedboudekak8574
    @mohamedboudekak8574 4 года назад +1

    thanks man ur my savior

    • @OdooMates
      @OdooMates  4 года назад

      happy to help always

  • @pollarolas
    @pollarolas 5 лет назад +1

    Could you please upload a tutorial on how to send mass marketing emails without being blacklisted. Thanks

  • @emadraafat7651
    @emadraafat7651 5 лет назад

    Thank you Odoo mates
    i have a question how can i send a context to email and
    how to change person who will receive that email depends on python code

  • @italaa86
    @italaa86 5 лет назад +1

    Hello thank you very much man !

  • @edwinvaldez94
    @edwinvaldez94 3 года назад +1

    They could make an example of sending the registration link in an email

    • @OdooMates
      @OdooMates  3 года назад

      ok we will try to add it in v14 playlist

  • @ganbaatarburiad400
    @ganbaatarburiad400 5 лет назад +1

    Do you have any cron development?. Thank you, from MGL

    • @OdooMates
      @OdooMates  5 лет назад +1

      We have already published a video on it

  • @MSFPMUSIC
    @MSFPMUSIC 4 года назад +1

    Do u know how to send attachment to whatsapp from odoo ??

    • @OdooMates
      @OdooMates  4 года назад

      you are able to manage text message right ? if so can you refer the same api doc

    • @MSFPMUSIC
      @MSFPMUSIC 4 года назад

      @@OdooMates yes.. I can.. But I didn't get the exact doc for attachment.. I did coding for sending text message by just concatenate the url with the number and the message to it using the WhatsApp web...
      Actually I have no API as now...

  • @ibrahimhalouane8130
    @ibrahimhalouane8130 4 года назад +1

    Why you didn't use the decorator @api.multi for the function?

    • @OdooMates
      @OdooMates  4 года назад +1

      Its not mandatory to use the decorator and i guess by default it will be multi

  • @lukejones7626
    @lukejones7626 3 года назад

    Another awesome video, thank you!

    • @OdooMates
      @OdooMates  3 года назад

      Will this help ? ruclips.net/video/J3MvgwHnR0A/видео.html

  • @omarahmed299
    @omarahmed299 4 года назад +1

    hi
    good tutorial
    in my custom module i inherited 'crm_lead' model and then created 'mail.template'
    what should i add in ref

    • @OdooMates
      @OdooMates  4 года назад

      Hope we have cleared it :)

    • @sergelouie6
      @sergelouie6 4 года назад

      ref="mymodule.model_crm_lead"

  • @beautysinha6758
    @beautysinha6758 5 лет назад +1

    I am having one error..
    I m getting error
    Undefined: none type has no attribute partner_id on writing email code and mail template
    Plzz tell me reason of this
    Because of this partner_ I'd is not getting email

    • @OdooMates
      @OdooMates  5 лет назад

      Is there a field with the name partner_id in your model ?

    • @beautysinha6758
      @beautysinha6758 5 лет назад +1

      Odoo Mates yes I m inheriting sale.order model
      Nd in sale.order model partner_id is present.

    • @OdooMates
      @OdooMates  5 лет назад

      @@beautysinha6758 Make sure that the object of the sale.order model, suppose if the sale_id is your field make sure that it holds a value in it

    • @beautysinha6758
      @beautysinha6758 5 лет назад

      Odoo Mates partner_id is not getting value in it..
      Can I send u my code in ur Gmail.
      Soo that u can help me out

    • @beautysinha6758
      @beautysinha6758 5 лет назад +2

      Odoo Mates
      ${object.partner_id.id}
      I had written this line..
      When I remove .id then I m not getting any error..
      But problem is mail is not sending to customer i.e partner_id

  • @tiendungnguyen158
    @tiendungnguyen158 5 лет назад +1

    thank you!

  • @palanikumar8023
    @palanikumar8023 4 года назад

    how to send a mail automatically when a activity in pipeline is created to the user...

  • @maaneadel2815
    @maaneadel2815 3 года назад +1

    hi bro, please how to configure incoming and outgoing e-mail odoo 14

    • @OdooMates
      @OdooMates  3 года назад

      Can you check this link: www.odoo.yenthevg.com/configure-outgoing-mailservers/

  • @kevinmarvincalda6929
    @kevinmarvincalda6929 4 года назад

    Hello sir, What would be the jinjan variable for the current user? example: uid, I want to use it for the "from" field in template. Thank you!
    Edited:
    I was able to find it, the jinja variable for the current user is ${user.email_formatted | safe}. Anyways, keep on uploading sir, It really helps me for my current projects. Hoping for more videos! God bless!.

  • @rogerfederer7286
    @rogerfederer7286 3 года назад +1

    logearse al portal pero con un mail de confirmacion

    • @OdooMates
      @OdooMates  3 года назад

      you can enable two factor authentication , this will help ?

  • @mohamedboudekak8574
    @mohamedboudekak8574 4 года назад

    am having an error when clicking Setting=>Technical=>Emails
    raise ValueError(message)
    ValueError: Field `fetchmail_server_id` does not exist
    Error context:
    View `n/a`
    [view_id: n/a, xml_id: n/a, model: n/a, parent_id: n/a]

  • @odootiengviet3902
    @odootiengviet3902 3 года назад +1

    How to send email to multiple people

    • @OdooMates
      @OdooMates  3 года назад

      in the to field, you can add as much as people you need

  • @ajaychaudhari1499
    @ajaychaudhari1499 4 года назад

    Hi good explanation
    I followed all steps very carefully but got this error,
    please help me to solve it.
    tpl_partner_ids = [int(pid) for pid in partner_to.split(',') if pid]
    ValueError: invalid literal for int() with base 10: 'Vishal'
    here vishal is patient's name.

    • @OdooMates
      @OdooMates  4 года назад

      Can you take the code from here and compare: apps.odoo.com/apps/modules/12.0/om_hospital/

    • @futhedude4848
      @futhedude4848 2 года назад

      I've found the answer in case some one who got the same error:
      Follow below steps:
      1. Turn on developer mode and go to technical > Email templates
      2. In the search bar, Group By 'Created By'. This will show you that theres 35 records created by Odoo Bot
      3. Check/Tick all of the records created by Odoo Bot.
      4. Uncheck only records that the column Applies to have Gamification Challenge and Gamification User Badge on it
      5. Delete the selected records.
      6. Go back to home screen and open the Apps app.
      7. In the search box type in 'Base'.
      8. You will find a module named 'Base'.
      9. Upgrade it and your issue will be fixed. Well for me it did.