Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
$ openssl s_client -connect smtp.gmail.com:465 -crlf -ign_eof............... ###Server Response ###Connection to the server will be established..............EHLO localhost ### Server ResponseAUTH LOGIN ###Server ResponseOpenSSLbase64username ###Server ResponseOpenSSLbase64password ###Server ResponseMAIL FROM: <abcdabcd@gmail.com> ###Server ResponseRCPT TO: <abcd1234@yahoo.com> ###Server ResponseDATA ###Server ResponseSubject: Test email through smtp.google.ca with opensslMessage body.. ###Server ResponseQUIT
path = require ('path')webdriverio = require ('webdriverio')var locationvar options = { desiredCapabilities: { browserName: 'firefox' }};webdriverio .remote(options) .init() .url ('https://gmail.com') .setValue ('input[type="email"]', 'username123') .click('#next') .windowHandleMaximize() .waitFor('input[type="password"]',5000) .setValue ('input[type="password"]', 'password123') .click ('#signIn') .waitFor('input[aria-label="Search"]',20000) .click('#:3w') .waitFor('img[alt="In new window"]',10000) .saveScreenshot("test") .close();
And if we can't use a shell script to execute these commands then I should probably try writing a javascript/php script for it. What do you think I should do? Will the already existing codes in CiviMail be of any use here?
Another question, what are we going to do about pictures and other attachments?
The waiting times don't prove sufficient sometimes and the program returns with errors. What waiting times do you think we should use?
## Download the code$ git clone https://github.com/utkarshsharma/webmail-renderer$ cd webmail-renderer$ npm install## Create a config file$ cp config.json.template config.json$ vi config.json (<== Put in gmail credentials ==>)## Run the renderer$ npm main.js
The URL should be configurable (config.json / config.json.template)
Poll the address periodically (eg once every minute) and run the preview.
The changes including the nodemailer part have been pushed to github.
{ "gmail": {"username": "myusername", "password": "mypassword"}, "send": {"username": "myotherusername", "password": "myotherpassword"}}
QuoteThe URL should be configurable (config.json / config.json.template)EditedGot it. The URL to the file should be configurable by the user. I'll add another field in the config.json.template for the user to enter path to the email json file.
QuotePoll the address periodically (eg once every minute) and run the preview.Is this for the case the message hasn't reached before we start the webdriverio script?If that is what it meant, I just have to keep looking every minute for the email from the unique email id and not proceed to the code which takes the screenshot, until I can find such an email. Am I correct?
I haven't yet started working on extending the code to another email client. How should I go about it? One after the other or parallely (if that's possible)?
{ "subject": "Renderer Testing", "body_html": "<h1>This</h2> <p><b>message</b> <i>is</i> a <u> test message</u>.", "body_text": "This message is a text message", "render_with": "gmail"}
Is there a particular reason we want to use PhantomJS?