Skip to content

Instantly share code, notes, and snippets.

@ionox0
Last active December 29, 2017 17:04
Show Gist options
  • Save ionox0/40f7ec374a5599c3249912f0e070305d to your computer and use it in GitHub Desktop.
Save ionox0/40f7ec374a5599c3249912f0e070305d to your computer and use it in GitHub Desktop.
Auto populate list for sending donation requests email
var emails = ['[email protected]']
var $ = jQuery;
var one = $('#msg_cat_wizard_add_contacts')[0]
var four = $('#email-wizard-add-contact-email')[0];
async function doit(email) {
one.click();
four.value = email;
var five = $( "button:contains('Add')" )[5];
five.click();
await sleep(2000);
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
for (var i = 0; i < emails.length; i++) {
email = emails[i];
doit(email);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment