How to place a link to a view in the email template of odoo - email

In my custom room booking application, when user book a room a mail will send to the admin. In the mail template, there is an approve button. Once the admin clicks the approve button, it should redirect to the approval form view. How can I do that by placing a link in the email template?

The url you have to compose is of the following form:
http://odoo.server.com/web?db=#id=&view_type=form&model=

You can put in your template a text ${ctx['url']} and then render send template with template.with_context(url=url).send_mail(self.id). ${ctx['url']} will be replaced with url you passed along with context.

Related

Can we call Lwc or Aura component inside VF Email Template

I have a requirement in which email notification we have to provide a link which will redirect approver immediately to the approval page. I found one relevant solution mentioned in below URL
URL :-
https://www.vandeveldejan.com/create-an-approval-notification-with-visualforce-email-template-containing-quote-and-quotelineitems/
which says to create visualforce component, I wanted to check if we can user LWC instead of visualforce.
As I am new to LWC expecting some help to understand if we can call LWC component inside Visualforce Email Template.
I have followed the same steps but wanted to know If I can use LWC compoenent or Aura instead of VF page compoenent
https://www.vandeveldejan.com/create-an-approval-notification-with-visualforce-email-template-containing-quote-and-quotelineitems/
No.
Think about it. You want to create an email that on opening would immediately start a browser (hope the user is logged in to salesforce) and navigate to some page? without user clicking anything? That'd be a security nightmare. Can I send you an email which will use your Amazon account to order some stuff for me ;)
You can't run javascript inside emails (and even if you could - email clients should block it) so no LWC runtime... How would it even login to SF to pull data?
You need to learn Visualforce for this email template or send the email straight from apex (write the email's plaintext/html body with apex)
You can create public community, create public page and add your custom AURA or LWC component. Then copy link to this public community with your new page and add recordId in URL. I did this in Lightning AURA.

AMP for Email Form Component - Is it possible to redirect user to web page?

When using the AMP for Email form component, is it possible to redirect the user to a web page when one clicks the form submit button within the email?
No, it's not allowed. There's a section on this for the AMP for Website format: https://amp.dev/documentation/components/amp-form/#redirecting-after-a-submission, but notice that the section is not there for the email format: https://amp.dev/documentation/components/amp-form/?format=email.
See also https://github.com/ampproject/wg-amp4email/issues/17#issuecomment-1192025183.

Is there any url params available for redirect after send an email in gmail url?

I have a link in my web-app for user sending an email. The URL looks like this below :
https://mail.google.com/mail/u/0/?view=cm&to={your#email.com}&fs=1&tf=1
When user click that link, they can compose an email with compose mail view. After a user click the 'send email' button, the page will appear blank.
So my question, Are there any URL parameters that support redirection instead of giving the user blank page after sending email? I couldn't found any documentation for Gmail URL parameters just like view, to, fs, tf. I wonder is there any url parameter for example redirect_to=myapps.com.

How do I set the Google Form to automatically send to another user in HTML format other than respondent?

How do I set the form to automatically send to another user in HTML so it looks like the one the user gets when the user checks the "Send me a copy of my responses" box? I can't figure out how to set a script and/or trigger to send the HTML form to a user other than the respondent.
You can do this with google apps scripting, in particular the function MailApp.sendEmail. For HTML messages be sure to make use of the advanced parameters like htmlBody.
Check out the MailApp class for full details:
https://developers.google.com/apps-script/reference/mail/mail-app

Can you make a mailchimp form validate on onsite

I've made a mailchimp newsletter form with two fields; Name and Email. When i click it obviously loads the page where the designed form is to on my mailchimp account. How would i go about make it all work on my site and just post the information over to mailchimp.. my goal is not to have the user leaving the splash page.
I did try just including the java include code and that seems to do everthing on the page as i want, but then i can't style the form because it's pulling in all it's styles from Wufoo.
Regards
M