Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
marketing socialmarketing email iap #marketing
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
marketing socialmarketing email iap #marketing
About this forum
  1. Marketing
  2. Forum

How to send invitation e-mail to a survey in marketing automation

Subscribe

Get notified when there's activity on this post

This question has been flagged
actionsurveyservermarketingautomation
4 Replies
5366 Views
Avatar
Dominik Jenzer

When you share (button) a survey, you get an email template where you can add a recipient (eg customer).


Can anyone guide me creating a server action that does this within a marketing automation activity? I think, the server action has to do two thints:

1. Set the recipient

2. Send the email


Thanks for support

0
Avatar
Discard
Avatar
Gracious Joseph
Best Answer

To send a survey invitation email automatically within a Marketing Automation Activity in Odoo, you can use a Server Action to generate and send the survey email. Below is a step-by-step guide on how to achieve this:

1. Prerequisites

  • Ensure the Surveys module is installed.
  • Create or have an existing survey ready to send.
  • Make sure you have a working email setup configured in Settings > Email.

2. Create an Email Template

  1. Navigate to Email Templates:
    • Go to Settings > Technical > Email > Templates.
    • Click Create to design a new email template for your survey.
  2. Set the Template Details:
    • Name: Enter a meaningful name (e.g., "Survey Invitation").
    • Model: Choose the relevant model (e.g., "Contact" or "Survey").
    • Body: Design the email body and include the survey link. You can use placeholders for dynamic fields:
      Hello ${object.name},
      
      We invite you to participate in our survey. Please click the link below:
      
      ${object.response_url}
      
      Thank you!
      
    • Save the template.

3. Create the Server Action

  1. Navigate to Server Actions:
    • Go to Settings > Technical > Automation > Server Actions.
    • Click Create to define a new server action.
  2. Configure the Action:
    • Name: Enter a descriptive name (e.g., "Send Survey Invitation").
    • Model: Select the model where the server action will run (e.g., "Survey", "Contact", or "Lead").
    • Action To Do: Choose Execute Python Code.
  3. Add Python Code: Use the following Python script to send the survey email dynamically:
    template_id = env.ref('your_module_name.email_template_survey_invitation')
    if template_id:
        for record in records:
            template_id.send_mail(record.id, force_send=True)
    
    • Replace your_module_name.email_template_survey_invitation with the technical name of the email template created in Step 2.

4. Add the Server Action to Marketing Automation

  1. Create or Edit a Campaign:
    • Go to Marketing > Automation.
    • Create a new campaign or open an existing one.
  2. Add an Activity:
    • Add an activity that triggers the server action. For example:
      • Trigger Type: Email Sent, Record Creation, or Specific Time Delay.
      • Action: Select the server action created in Step 3.

5. Test the Setup

  • Trigger the marketing campaign or activity.
  • Verify that:
    • The email is sent to the recipient.
    • The survey link is included and functional.

6. Additional Notes

  • Dynamic Survey Links: If the survey is linked to a specific recipient, ensure the email template dynamically includes their response link using the response_url field.
  • Error Handling: Include logging in the server action to capture any errors:
    try:
        template_id.send_mail(record.id, force_send=True)
    except Exception as e:
        _logger.error("Error sending survey invitation: %s", e)
    

Outcome

When the marketing automation activity triggers the server action, it will dynamically send the email to the recipients with the survey link. This allows you to automate survey invitations seamlessly.

Let me know if you need further assistance!

1
Avatar
Discard
Avatar
Pablo Lozano
Best Answer

Yes the solution in odoo 16 (17 and 18), you can create a email template in the model you need example Sales Order.
With Qweb edit the template and write: you can sustitute the object.x_studio_many2one_field_SLIMM.get_start_url() with link you have of survey.



    <a t-att-href="object.x_studio_many2one_field_SLIMM.get_start_url()" style="box-sizing:border-box;background-color: #875A7B; padding: 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">

        Survey

    </a>

And go to Technical -> Automated Actions, you push in new and action to do send by email.

0
Avatar
Discard
Avatar
Micheal KARL
Best Answer

Hi, have you found a solution for that?

Best regards, michael 

0
Avatar
Discard
Avatar
Jules
Best Answer

Hello, 

I'm also looking to do this. 

Have you found the solution?

Thanks

0
Avatar
Discard
Pablo Lozano

I posted one of possible solution!

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
Related Posts Replies Views Activity
Send emails with automated action when a purchase request is created, odoo 13 community Solved
action mail server automation
Avatar
Avatar
1
Mar 24
2892
Trigger on lead automation - marketing.campaign module
action marketing lead automation
Avatar
1
Jun 22
5922
Double Opt-in - Marketing automation
marketing automation
Avatar
0
May 25
1613
Marketing Automation
marketing automation
Avatar
1
Feb 25
8176
difference between server actions and client actions in Odoo? Solved
action server
Avatar
Avatar
Avatar
Avatar
3
Jun 23
13498
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now