Can we call Lwc or Aura component inside VF Email Template - apex

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.

Related

Using spfx webparts, would there be a way to either programmatically send an email which has a link to open a modal or using flow?

I want an spfx made webpart that I've made be able to send an email (I'm using IEmailProperties at the moment) which provides a link to a modal form?
For example:
User clicks button in webpart, form loads.
User fills out form and submits it to SP list.
Form sends email on submission. Email has a link to the actual item created, so when the user clicks the provided email link, it opens up the modal form.
I would presume that the user would HAVE to be sent to the SP page where the webpart is unconditionally, but would it be possible to open up the modal corresponding to the SP list item?
Is this feature available in SharePoint framework, because if it isn't, compared to something like InfoPath 2013 or PowerApps it's quite a limitation.
I've researched this with several shallow Google searches and on gitHub for any premade stuff, but alas there is nothing that I've spotted.
I've been told IT IS possible:
"Yeah, they’d have to visit the page. Email clients don’t do JavaScript so you can’t really do interactive stuff there. If you want to take them directly to a page that then displays a modal, that’s plenty possible though. (e.g. display the modal based on if the URL contains a certain string)"
But wouldn't know how to do the above, can anyone start me on the right path?
Regards,
T
In the email, pass a query string containing the item ID/list ID etc of the item, then have the webpart read the See: How can I get query string values in JavaScript? If your values exist. If they do exist, then open the modal using some kind of framework like bootstrap or fluent UI. You can write your own form using PnPjs or use an iframe potentially to display the OOTB edit form.
Additionally, you can link to any page in SharePoint provided you use an extension instead of a webpart to host the modal. You can install extensions tenant wide, and have it listen for the query string.

Capturing URL from Form Submission Tracking - Google Analytics

I'm looking to record the URL from which a form submission was sent from with Google Analytics.
Example:
Imagine domain.com. On domain.com Google Analytics (ga.js) is installed in the header.php and is on every page of the site. Similarly, in domain.com's footer.php there's the same contact form generated on every single page of the site.
Now, User 1 goes to domain.com. User 1 navigates to domain.com/page-c.html. User 1 submits a form from the footer contact form on page-c.html.
I want to know that a form was submitted from page-c.html. Or if User 2 submits from page-u.html then I know that a form was sent from page-u.html. It is not important that I know that it is User 1 or User 2. I just want to know the URL from which the form was sent.
Anyone know how to do this with Google Analytics? -- If not, maybe another analytics service?
You can use Google Tag Manager. Which can not only implement all the standard analytics capabilities but also lets you add event triggers with built-in variables. For example you'd enable the Page URL variable in GTM and add a Analytics Tag of type Event with Event Category, Action, Label being things like Contact Form, Submit, {{Page URL}} respectively. Then create a new trigger (triggers tell when to fire a tag). This trigger should be enabled always (i.e. something like PagePath contains / and be of type Form Submission. You can target it even better by saying trigger when to be when the Form ID is equal to the ID attribute of your contact form. This way you prevent conflicts with other forms triggering your event tag.
You can read extensively on Google Tag Manager here. It is a great tool to fine tune analytics and get more out of it.

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

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.

GWT stand alone page?

My app has an email newsletter and i'd like to implement an "Unsubscribe" option on the HTML email itself. This link would bring them to an isolated page that simply lets them know they've been unsubscribed, i'll grab their user info from URL parameters. There should be no way to access this page from within the app.
I was able to create an html file that's a sibling in the war folder to my host page and access it. How, in my app, do i detect that a user has accessed this page and then handle it? I don't need code to be shown to me, i just need a point in the right direction.

Custom email notification with link - sitecore

I created a workflow as below, i want to send email with the link to the content approvers group when something is submitted? Can someone point me from where should i start with? which is the function that should be overridden ? Any help is appreciated
Thanks,
GT
Here is a good example of how to create a custom workflow email that can be sent to users in a particular Sitecore role (and the user who last edited the content item).
http://techmusingz.wordpress.com/2014/04/25/workflow-notifications-in-sitecore-roles-and-users/
You can link to a specific content item in the Sitecore client using the following method but you need to already be logged in to the Sitecore client for this to work (Otherwise you are just directed to the Sitecore login page and won't be redirected to the item after login).
/sitecore/shell/Applications/Content%20Manager/default.aspx?fo={id}&la={language}&vs={version}&mo=preview
fo - The item to open in the Sitecore client
la - The language to open (optional)
vs - The version to open (optional)
mo - preview
(optional)