Automate account creation by joining mailing list? - wordpress

I'm using Wordpress/WooCommerce where users can join the mailing list in MailChimp. But is there a way to also automate account creation after they join the mailing list and generate a temporary password to be sent via email?

Yes, it's possible. Look into MailChimp webhooks.
Basic flow would be:
1. User subscribes
2. MC sends post request to specified callback URL (you can make a page with custom template for example. Easiest way) upon subscription
3. Your page at specified callback URL accepts JSON sent by MC
4. Create new account
5. Send generated password to email
Optionally, you can also set up unsubscribe webhook and remove account when that happens.

Related

Customized email verification success page using Firebase

I am generating email verification using the default Firebase function.
The default email verification success page looks like that:
I want to customize the response page after successful email verification.
Is there a way to do that?
I want to customize the response page after successful email
verification. Is there a way to do that?
Yes, as Frank indicated in his above comment, it is possible and the documentation he refers to explains the mechanism.
As explained in this doc (and also in my other answer :-) ), you need to build a web page in which you will:
Get the values passed as QueryString parameters (e.g. mode or oobCode)
Call, from this web page, the applyActionCode() method of the Firebase JavaScript SDK, passing the values of these parameters to the method.
Upon successful verification, do something, like redirect the user to your app login page.
What's important to note is that you have two ways to generate the email sent to the user (which contains the link to the page described above):
1. Rely on the default Firebase mail mechanism. In order to customize the URL of the verification link (e.g. you want to redirect to https://www.myrapp.com/emailVerifyScreen) you need to change the base URL as shown in the below image ("Customize action URL"). Also explained here in the doc.
2. Send the email through a Cloud Function (or through a server you own). In this case you need to:
a/ Call the generateEmailVerificationLink() method of the Admin SDK, which returns a link
b/ Generate an email containing this link
c/ Send the email to the user (via an SMTP server you control or via a microservice like Mailjet or Sendgrid)
You may have a look at these other answers:
https://stackoverflow.com/a/66350538/3371862
Flutter: Sending Email Verification code through FlutterFire?
How to sign up only the users who have verified thier email addresses using the email link in Firebase javascript?

Firebase custom verification email

I read some other posts about this topic but couldn't finally figure out how to accomplish this.
I want to send the email-verification email normally send from firebase itself from my own email-provider (like mailjet e. g.) The reason is that I want to customize the email text etc.
I also read about creating a custom email handler which I would do too. But this just handles the action that happens when the user clicks on the link in the email.
At the moment I call this from my flutter app after the users sign up:
user.sendEmailVerification();
this makes firebase send the standard verification email to the user. Instead of doing that I'd need to send the email myself. But like seen here I need to have this oobCode generated. to generate a correct link to handle. I just can't find an example on how to do that. What would be the right approach to send the email myself? Maybe I just did not find the right resource. Thanks a lot.
You need to generate and send the email via a backend, by using the Admin SDK. The easiest is to use a Cloud Function, from which you use the Mailjet NodeJS API wrapper.
So, in the Cloud Function, you need to:
Call the generateEmailVerificationLink() method of the Admin SDK, which returns a link
Generate an email containing this link
Send the email to the user (see the Mailjet NodeJS API wrapper documentation)
The first steps are detailed here in the doc.
In order to customize the URL of the verification link (e.g. you want to redirect to https://www.myrapp.com/emailVerifyScreen) you need to change the base URL as shown in the below image ("Customize action URL"). Also explained here in the doc.
Then, when the user clicks on the link in the email he/she has received, you need to do what is explained in the doc you referred to in your question: Create custom email action handlers. See the point #4 "Handle email address verification by calling applyActionCode".
Concretely, in the page of your app https://www.myrapp.com/emailVerifyScreen, you get the query string values from the URL (e.g. var actionCode = getParameterByName('oobCode');) and you use these values to call the applyActionCode(actionCode) method. When the promise returned by this method is fullfilled, you know that the email has been verified.
var actionCode = getParameterByName('oobCode');
auth.applyActionCode(actionCode).then((resp) => {
// Email address has been verified.
// TODO: Display a confirmation message to the user.
// You could also provide the user with a link back to the app.
// TODO: If a continue URL is available, display a button which on
// click redirects the user back to the app via continueUrl with
// additional state determined from that URL's parameters.
}).catch((error) => {
// Code is invalid or expired. Ask the user to verify their email address
// again.
});
One last point to note: you cannot directly get the oobCode alone. The generateEmailVerificationLink() method generates the full URL.
The answer mentioned above is absolutely correct , I am just adding to that how you can create action url in two ways for testing and then deployment way.
1> for custom email action handler you would have to create your own handlers (using HTML and js , react app , flutter anything you want) after doing that you can either test your handler by routing traffic to it (localhost) using ngrok(that will provide you with https url to route traffic on localhost, preferred method for testing) , or you can deploy it and directly use that url . now with that url go to firebase(your project) -> authentication -> templates -> use whatever handler you want( example reset password or email verification) -> edit and add custom action url to route traffic to your handler( hosted(deployed) or local(ngrok routing) .

Posting Notes on Gitlab API as a 'bot' user

I am developing an application that posts comments into Merge Requests on Gitlab. It works by authenticating with a given user, and then after some setup will register a webhook on the relevant project to be informed when a Merge Request update happens. When a new Merge Request is detected I want to post a comment on the Merge Request asking for some specific detail to be sent over.
However, when we post the comment on the Merge Request we can only ever seem to do it as the user that we have the OAuth token for (which of course makes sense). My question is what should we do/could we have done in order to post the note as a 'bot user' without having to register a full user into the repository? Or is this just impossible?
You can create a reporter user and use its access token. The problem my arise when the user doesn't have enough access control.
You can create a project scoped token, a bot user will automatically be created for such a token
Ref: https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html

Google form is showing user who created the form as submitting request

I created a google form as a work request form for my team at work. The request then goes to a google group (where all team members can access and pull from) The issue is when a request from the form comes to the google group it is showing that it was submitted by me and not by who is requesting the work, but when we go to the google spreadsheet to see the request it is showing the correct user who submitted.
How can I get the user (work email) who submitted to show in the google group?
Response to first comment-
Here is what a work request looks like coming into our group inbox (google group)
This is showing as being sent by Shaun, but I (Jessica) as in the second picture shows was the requester who filled out this work request
It appears that Shaun is the owner of the spreadsheet receiving the input from the google form, and/or the author of the script that generates an email from the form input and sends it to the google group. You don't say so explicitly, but I would guess that you're using a "Collaborative inbox" group type.
Since the email to the group comes from Shaun, that is the user profile that is displayed on the message, above the message content.
Possible options that fail:
While you can specify a different "from" address when sending an email via the GMail Google Apps Script service, you are limited to using your own registered aliases - so that isn't going to help you.
Instead of emailing the completed form, have the script generate the whole group entry on behalf of the Requestor (sic). Despite a 7-year-old feature request, there is no API that supports this.
So what will work?
If you're willing to forego the form and spreadsheet, each requester can send their own email, which will ensure that their credentials are used to display a user profile on the groups page. To guide use of standardized fields, you can provide a mailto link with the body of the email pre-formatted for users.
mailto:work-group#googlegroups.com?subject=Work+Request&body=Request+Type:+%0dProgram:+%0dWork+Package+Name:+
Such a mailto link can be embedded on a web page, or kept as a browser shortcut to make it easy on users.

Orchard CMS - Workflow Send Message to Email List

I would like to send an email notification to a distribution list every time I publish a post on my Orchard CMS blog. The list of emails is contained as a list of custom content items that get created as users submit a custom form to subscribe to emails. I know how to use the workflows feature to send an email notification whenever a content item is created to a fixed list of emails, but I would like to be able to send emails to a list derived from an email field value for instances of a custom content item. Is there an existing way to do this in Orchard, or will I have to write a module to do so?
You will have to write your own Action and a Token to do that.
Your Token will be the Distribution List and the Action of Sending of the mail.
Check orchard.Workflows.Activities, Orchard.Email.Rules (thats the send Email action)

Resources