Trigger dataLayer.push when user successfully registered or logged - forms

I'am having an issue with the deployement of GTM on a prestashop (1.7) shop.
I must send a dataLayer.push when an user login(true or false) and one when an user
registers.
The problem is that I don't know where to trigger the dataLayer.push only if the user successfully completed the form with the good informations..
Hopefuly you guys can help me out since I'am pertty new to Prestashop

you should use Prestashop hooks
and build a simple module that execute your code when the hooks are fired.
You can use the following hooks to suit you needs :
actionCustomerAccountAdd and
actionAuthentication

Related

Keycloak: how to send email to admin upon user registration / how to create a custom execution for sending email

I want to alter the User Registration flow to allow for emailing someone when there is a user registration. For altering the flow, this question provides an example.
However, in my case, there is no execution I could add out of the box to email someone other than the user. How can I go on to create a custom execution for sending email in order to send email to admin upon user registration?
Alternatively, I could start continuously polling the list of all users and diff it. This solution using the python-keycloak would be similar to what is described here but for my case, it seems both inefficient and cumbersome, the cron job would have to run all the time.
Any other way to solve this problem also welcome!
Unfortunately, I suppose this feature is not (yet?) supported
If i get your question correctly, you want to be notified by mail when someone creates an account? if so you can implement that in your code by checking for the keycloak response(200 or 201) after account creation and then you notify the necessary email. You can integrate with sendgrid.

Dynamics CRM - Register a plug-in when the user logs in

I would like to fire an event when the user logs in to his account on Dynamics CRM ? Such as opening a Web App beside the CRM... Is This possible ?
I know that I can write plug-in that allows to augment some business process such as account creation. Any advice will be appreciated !
CRM does not expose a plugin message for "UserLogon/UserAccess" on which you can register a plugin.
What you could do though is enable Audit User Access and register your plugin on Create of an audit entity and filter on the value in AuditAction (operation) and User Access Via Web (64) is the value you are looking for.
var entity = ((Entity)pluginExecutionContext.InputParameters["Target"]).ToEntity<Audit>();
if (entity.Operation.GetValueOrDefault() == 64)
{
//logic here
}
I think dynamicallyCRM gives a good idea, but if you are trying to open some website, plugin is not the option; it's meant to execute server side logic.
If all end users use the same homepage when login to CRM (let's say they are asked not to change it), you can set up a custom page as the homepage, and there you are able to add scripts to do whatever you want.

Start a workflow on page activation without activating the page in AEM 6.2

I need a setup where users can update a page and then submit it for approval/activation in AEM 6.2. The page would be submitted to workflow where a content approver/administrator would review and publish the page. This seems like a common setup for content managment, but I can't figure out how to do it in AEM.
I have done the following:
setup a user that has permission to update but does NOT have
replicate permission on folderX.
setup users with update and replicate permissions on folderX and added them to a group "content-authors-approvers"
created a workflow where the first step of the workflow is the page will be submitted for approval and publication to member of "content-authors-approvers" group
assigned this workflow to folderX
However, when a user does NOT have replicate permission, the "publish" option does not show up at all. This makes sense, really....but then, how does one go about setting up a workflow like this?
From what I've read about this in earlier versions of AEM/CQ5, the replicate/publish option was still available to all users, but it would automatically kick off workflow if the user did not have replicate permissions. (see Start a workflow on page activation without activating the page in CQ5 )
this seems to have changed in 6.2. can anyone help?
I have tried looking up online, but found nothing
There is a native workflow to handle that. It's named Publish Example. see it here: http://localhost:4502/etc/workflow/models/publish_example.html . I believe that it's better then the automatic triggering cause the author actually knows he triggers a workflow (whilst when it happened automatically there was no info about that). To explicitly call it you have to either from /siteadmin select a page and click workflow on it, or do it from sidekick or in touch.
sidekick:
touch - editpage:

Can I make a plugin to navigate the Web UI in Dynamics CRM

I am following the tutorial in:
https://msdn.microsoft.com/en-us/library/gg594416.aspx
to make a plugin for Dynamics CRM. It run on server side.
The plug-in creates a task activity after a new account is created. The activity reminds the user to follow-up with the new account customer one week after the account was created.
How can I extend this plugin to force the Web page to programmingly open the task that have just created?
You can't, the plugin runs server side and cannot interact with the user interface.
You would need to do something like add JavaScript that recognises when the plugin has completed and redirects the user.

Why is CRM 2013 Online Plugin running under SYSTEM user all the time

I've built a plugin for Microsoft Dynamics CRM 2013 Online platform. The plugin is registered at Delete of my_custom_entity. It is synchronous and post-operational. Impersonation is set to Calling user. As far as I know the plugin should be fired with the calling user's privileges etc. with these settings.
I can't figure out why, but my the plugin is always run under "SYSTEM" user. I've tried to use two different system users with no luck whatsoever. It's kind of a problem because my plugin is calling a workflow and the workflow is sending an email. SYSTEM user can't send emails though.
Is this something new in CRM 2013? I tried to Google but couldn't find anything relevant. I already tried to unregister and register my plugin assembly again. No difference.
How can I change my plugin registration so that it would run on behalf of a user who fires the plugin (who deletes an entity).
Thank you
How are you obtaining your service reference?
If you do it like this you should get all the actions performed as the user who triggered the plugin.
// Obtain the organization service reference.
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
If you are passing a null value you will get the system user, e.g. serviceFactory.CreateOrganizationService()
IOrganizationServiceFactory.CreateOrganizationService
Specifies the system user that calls to the service are made for. A
null value indicates the SYSTEM user. When called in a plug-in, a
Guid.Empty value indicates the same user as IPluginExecutionContext.
UserId. When called in a custom workflow activity, a Guid.Empty value
indicates the same user as IWorkflowExecutionContext.UserId. Any other
value indicates a specific system user.
YOu should use context.InitiatingUserId rather.
IOrganizationService service = serviceFactory.CreateOrganizationService(context.InitiatingUserId);
The InitiatingUserId will be the user who triggers the delete action. In Delete context, UserId will be System where the platform is using.