From 125a41fd07877f9d442d509b5bc5f7f3c8575b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81ro=CC=82me=20Loi=CC=88?= Date: Wed, 19 Nov 2014 11:21:31 +0100 Subject: [PATCH] added newsletter system --- package.json | 3 +- src/newsletter.js | 57 ++++++++++++ src/newsletter/hnewsletter.js | 39 ++++++++ src/newsletter/mail.txt | 2 + src/newsletter/newsletter.js | 27 ++++++ src/newsletter/sq03.txt | 59 ++++++++++++ src/newsletter/squatconf-news-01.sh.txt | 69 ++++++++++++++ src/newsletter/squatconf-news-02.hex | 116 ++++++++++++++++++++++++ 8 files changed, 371 insertions(+), 1 deletion(-) create mode 100644 src/newsletter.js create mode 100644 src/newsletter/hnewsletter.js create mode 100644 src/newsletter/mail.txt create mode 100644 src/newsletter/newsletter.js create mode 100644 src/newsletter/sq03.txt create mode 100755 src/newsletter/squatconf-news-01.sh.txt create mode 100644 src/newsletter/squatconf-news-02.hex diff --git a/package.json b/package.json index b2075fb..1ed1700 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "ecstatic": "^0.5.4", "level": "^0.18.0", "load-svg": "^1.0.0", - "mailgun": "^0.5.0", + "mailcomposer": "^0.2.12", + "mailgun-js": "^0.6.7", "rc": "^0.5.1", "stack": "^0.1.0", "tiny-route": "^2.1.1", diff --git a/src/newsletter.js b/src/newsletter.js new file mode 100644 index 0000000..fdfb4da --- /dev/null +++ b/src/newsletter.js @@ -0,0 +1,57 @@ +var email = ['gorhgorh@gmail.com'] + , config = require('../config') + , Mailgun = require('mailgun').Mailgun + , mg = new Mailgun(config.mailjetKey) + , ml = 'this is a test' + , longmail = ['surreira@gmail.com', + 'aditya@netroy.in', + 'agcline@gmail.com', + 'akylyn@gmail.com', + 'alan@gangleri.net', + 'bohagan@gmail.com', + 'davejustishh@gmail.com', + 'daviddias.p@gmail.com', + 'eduardo@sorribas.org', + 'emilien.ak@gmail.com', + 'eva.aufheber@gmail.com', + 'feross@feross.org', + 'frodoo@riseup.net', + 'froidure_nicolas@yahoo.fr', + 'g6pestana@gmail.com', + 'gagz@riseup.net', + 'groente@puscii.nl', + 'hannes@mehnert.org', + 'ian@iancrowther.co.uk', + 'itzmjauz@gmail.com', + 'kevinohagan@gmail.com', + 'lloyd@evilprofessor.co.uk', + 'martin@gausby.dk', + 'monikadac@hotmail.com', + 'nmirzoeff@gmail.com', + 'oli@tableflip.io', + 'perpetual-tripper@wwelves.org', + 'pixtron@gmail.com', + 'prauben@gmail.com', + 'rappnicolas@gmail.com', + 'ricard.solecasas@gmail.com', + 'roman.stulz@netcase.ch', + 'squatconf@web.expr42.net', + 'ten_shi@hotmail.fr', + 'thierry@marianne.io', + 'tiago.c.pontes.p@gmail.com', + 'zanzara@squat.net'] +; + +mg.sendText( + config.email.from +, email +, 'squatConf newsletter 01' +, emailCont +, {} +, function(err) { + if (err) console.log('Guru meditation: ' + err) + else console.log('done sir'); +}); + + +var emailCont = "#
\n\n#!/usr/doc\ncat <";
\ No newline at end of file
diff --git a/src/newsletter/hnewsletter.js b/src/newsletter/hnewsletter.js
new file mode 100644
index 0000000..1134386
--- /dev/null
+++ b/src/newsletter/hnewsletter.js
@@ -0,0 +1,39 @@
+var fs        = require('fs')
+  , config    = require('../../config')
+  , api_key   = config.mailjetKey
+  , domain    = 'squatconf.eu'
+  , mailgun   = require('mailgun-js')({apiKey: api_key, domain: domain})
+  , MailComposer = require('mailcomposer').MailComposer
+  , mailcomposer = new MailComposer()
+  , text      = fs.readFileSync('./squatconf-news-02.hex', 'utf8')
+  , allMail = fs.readFileSync('./mails.txt','utf8').split('\n')
+  , testMail  = ['gorhgorh@gmail.com','gorhgorh@lesnodebots.eu']
+;
+
+mailcomposer.setMessageOption({
+  from: 'no-reply@squatconf.eu',
+  bcc: allMail,
+  subject: 'squatConf - newsletter 02',
+  body: text,
+  html: '
'+ text + '
' +}); + +mailcomposer.buildMessage(function(mailBuildError, messageSource) { + + var dataToSend = { + to: allMail, + message: messageSource + }; + + mailgun.messages().sendMime(dataToSend, function (sendError, body) { + if (sendError) { + console.log(sendError); + return; + } + else{ + console.log('done'); + } + }); +}); + +//console.log(allMail); \ No newline at end of file diff --git a/src/newsletter/mail.txt b/src/newsletter/mail.txt new file mode 100644 index 0000000..c2d7464 --- /dev/null +++ b/src/newsletter/mail.txt @@ -0,0 +1,2 @@ +test@yopmail.com +test2@yopmail.com diff --git a/src/newsletter/newsletter.js b/src/newsletter/newsletter.js new file mode 100644 index 0000000..b8c529e --- /dev/null +++ b/src/newsletter/newsletter.js @@ -0,0 +1,27 @@ +var fs = require('fs') + , path = require('path') + , config = require('../../config') + , api_key = config.mailjetKey + , domain = 'squatconf.eu' + , mailgun = require('mailgun-js')({apiKey: api_key, domain: domain}) + , allMail = fs.readFileSync('./mails.txt','utf8').split('\n') + , filename = 'sq03.txt' + , filepath = path.join(__dirname, filename) + , file = fs.readFileSync(filepath) + , text = fs.readFileSync('./sq03.txt', 'utf8') + , attch = new mailgun.Attachment({data: file, filename: filename}) +; +var data = { + from: 'no-reply@squatconf.eu', + to: 'no-reply@squatconf.eu', + bcc: allMail, + subject: 'squatConf - venue infos', + text: text, + //html: text, + attachment: attch +}; + +mailgun.messages().send(data, function (error, body) { + console.log(body); +}); + diff --git a/src/newsletter/sq03.txt b/src/newsletter/sq03.txt new file mode 100644 index 0000000..46c0d98 --- /dev/null +++ b/src/newsletter/sq03.txt @@ -0,0 +1,59 @@ +# SquatConf 101 + + +hey hey this already squatconf -2 days !!! + +So here are some information to make your day better. + +fist of all THERE ARE NO TICKETS. so be there on time and you'll have some good spot, be late and we'll try to squeeze you in somewhere. + +## tl;dr + +Squatconf 15th nov +from 10:00 to 18:00 - then party after til late + +## Address + +hangar 56 +56 avenue parmentier, 75011 paris +Metro : parmentier + +closest tube station is "Parmentier" on the 3 line. + +# schedule + +There is no schedule. + +Formats of the talks will vary and you'll have plenty of time to meet and speak with the speaker in between. + +The After party is something we did not expect at all, since it was already scheduled before the hangar opened us our door, in the end it kind of fits the thing. + +It will be a movie projection of an old french z-movie (made by Jean Rollin himself !!!) with some live band concert, some info (in french tho) [here](https://www.facebook.com/events/669196053178372/) (there are links to the bands's websites) + +# Facilities (may be limited) + +There will be a shortage of seats. Feel free to bring something to sit on. + +BYO internet, or have a day offline. + +The Squat has a bar with coffee/tea, soft drinks, beer. +They have kindly allowed us to use the space for free, +so thank them by buying all their drinks as fast as possible. + +The bar takes cash only. + +We will cook a big curry pot for lunch. If this is not your thing there are plenty of restaurants (etc) nearby. + +# Reminder + +Hangar 56 is a _home_ so common courtesy applies here, please use your brains. + +- Private areas ARE private (ground floor only) +- _Ask before you take a picture_, delete if asked to. +- Do not film talks +- Be polite + +This event is made by people from all over the world, with no budget. +Speaker are paying their trip on their own, thus, this event will be on donation. + +We can't thank enough our speaker for their commitment but we would be happy that you think about it when coming. \ No newline at end of file diff --git a/src/newsletter/squatconf-news-01.sh.txt b/src/newsletter/squatconf-news-01.sh.txt new file mode 100755 index 0000000..50edc6e --- /dev/null +++ b/src/newsletter/squatconf-news-01.sh.txt @@ -0,0 +1,69 @@ +#
+
+#!/usr/doc
+cat <
\ No newline at end of file
diff --git a/src/newsletter/squatconf-news-02.hex b/src/newsletter/squatconf-news-02.hex
new file mode 100644
index 0000000..35f6eb0
--- /dev/null
+++ b/src/newsletter/squatconf-news-02.hex
@@ -0,0 +1,116 @@
+00000000  23 21 2f 75 73 72 2f 64  61 72 67 65 20 65 76 65  63 65 20 74 68 61
+00000010  72 0a 0a 41 6e 20 68 69  20 79 6f 75 20 72 65 61  62 65 20 70 72 6f
+00000020  20 31 73 74 20 65 76 65  74 20 74 6f 20 73 70 65  73 65 6e 74 61 74
+00000030  68 61 70 70 65 6e 20 69  73 6f 6d 65 62 6f 64 79  20 63 6f 6d 69 6e
+00000040  6f 6e 20 74 68 65 20 31  |........................................|
+00000050  6d 62 65 72 20 32 30 31  |.#!/usr/doc.............................|
+00000060  20 65 78 63 69 74 65 64  |........................................|
+00000070  75 6e 63 65 20 74 68 61  |.tl;dr..................................|
+00000080  6e 75 65 20 69 73 20 61  |.=====..................................|
+00000090  61 6d 61 7a 69 6e 67 20  |.An historical 1st event will happen in.|
+000000a0  20 31 31 74 68 20 64 69  |.Paris on the 15th November 2014........|
+000000b0  66 20 50 61 72 69 73 2c  |.We are excited to announce that the....|
+000000c0  75 73 20 77 69 6c 6c 20  |.venue is a really amazing space in the.|
+000000d0  63 6f 6d 66 4f 72 74 61  |.11th district of Paris, all of us will.|
+000000e0  65 2e 0a 0a 2d 2d 2d 2d  |.be very comfortable there..............|
+000000f0  2d 2d 2d 2d 2d 2d 2d 2d  |........................................|
+00000130  2d 2d 2d 0a 0a 6e 65 77  |.newsletter #2..........................|
+00000140  23 32 0a 0a 57 69 74 68  |.=============..........................|
+00000150  77 65 65 6b 73 20 74 6f  |.With just 2 weeks to go until we open..|
+00000160  6c 20 77 65 20 6f 70 65  |.our doors, it's time to fill in a few..|
+00000170  6f 72 73 2c 20 69 74 27  |.more details for you. We have been.....|
+00000180  6f 20 666 9 6c 6c 20 69  |.very fortunate during the call for.....|
+00000190  6d 6f 72 65 20 64 65 74  |.papers process and we are pleased to...|
+000001a0  20 79 6f 75 2e 20 57 65  |.announce that we will be providing.....|
+000001b0  65 6e 20 76 65 72 79 20  |.presentation topics coming from all....|
+000001c0  65 20 64 75 72 69 6e 67  |.over the world, converging for 1 day...|
+000001d0  6c 20 666 f 72 0a 70 61  |.to share knowledge and socialize with..|
+000001e0  63 65 73 73 20 61 6e 64  |.like minded individuals, the theme has.|
+000001f0  70 6c 65 61 73 65 64 20  |.sort of evolved in it's own way,.......|
+00000200  6e 63 65 20 74 68 61 74  |.although we did give some guidance as..|
+00000210  20 62 65 20 70 72 6f 76  |.to what we expected, but essentially...|
+00000220  65 73 65 6e 74 61 74 69  |.this event has become a platform, a....|
+00000230  73 20 63 6f 6d 69 6e 67  |.meeting place, to be with friends and..|
+00000240  6c 20 6f 76 65 72 20 74  |.to create a shared experience..........|
+00000250  2c 20 63 6f 6e 76 65 72  |........................................|
+00000260  20 31 20 64 61 79 0a 74  |.this is the expected content...........|
+00000270  6b 6e 6f 77 6c 65 64 67  |.for saturdays presentations............|
+00000280  63 69 61 6c 69 7a 65 20  |.(not in any particular order):.........|
+00000290  65 20 6d 69 6e 64 65 64  |........................................|
+000002a0  75 61 6c 73 2c 20 74 68  |...* Javascript Web Cryptography........|
+000002b0  0a 68 61 73 20 73 6f 72  |.....(W3C WebCrytpo API)................|
+000002c0  6c 76 65 64 20 69 6e 20  |........................................|
+000002d0  20 77 61 79 2c 20 61 6c  |...* Open Source Aquaponics.............|
+000002e0  65 20 64 69 64 20 67 69  |.....(with an open data network)........|
+000002f0  67 75 69 64 61 6e 63 65  |........................................|
+00000300  68 61 74 20 77 65 20 65  |...* The intranet of things.............|
+00000310  20 62 75 74 20 65 73 73  |.....(own your data with IoT)...........|
+00000320  20 74 68 69 73 20 65 76  |........................................|
+00000330  62 65 63 6f 6d 65 20 61  |...* Edgenet............................|
+00000340  6d 2c 0a 61 20 6d 65 65  |.....(a new kind of Internet)...........|
+00000350  63 65 2c 20 74 6f 20 62  |........................................|
+00000360  72 69 65 6e 64 73 20 61  |...* OpenGL goes Bananas................|
+00000370  65 61 74 65 20 61 20 73  |.....(illusions with maths & the GPU)...|
+00000380  70 65 72 69 65 6e 63 65  |........................................|
+00000390  69 73 20 74 68 65 20 65  |...* Bluetooth Low Energy for Good......|
+000003a0  63 6f 6e 74 65 6e 74 20  |.....(BLE all the things)...............|
+000003b0  72 64 61 79 73 20 70 72  |........................................|
+000003c0  6f 6e 73 0a 28 6e 6f 74  |...* REBOOT THE WEB.....................|
+000003d0  70 61 72 74 69 63 75 6c  |.....(making web crypto viable).........|
+000003e0  29 3a 0a 0a 20 20 2a 20  |........................................|
+000003f0  70 74 20 57 65 62 20 43  |...* Transmission.......................|
+00000400  70 68 79 20 28 57 33 43  |.....(UDT a fast protocol)..............|
+00000410  70 6f 20 41 50 49 29 0a  |........................................|
+00000420  6e 20 53 6f 75 72 63 65  |...* Viva La Crypto.....................|
+00000430  69 63 73 20 28 50 75 62  |.....(decentralized crypto-revolution)..|
+00000440  20 4e 65 74 77 6f 72 6b  |........................................|
+00000450  68 65 20 69 6e 74 72 61  |.this will be single track format,......|
+00000460  68 69 6e 67 73 20 28 6f  |.talks will be about 25 minutes each....|
+00000470  64 61 74 61 20 77 69 74  |.but some may be longer (up to 50 mins).|
+00000480  20 20 2a 20 65 64 67 65  |.we will try to create as many..........|
+00000490  65 77 20 6b 69 6e 64 20  |.opportunities for conversation as......|
+000004a0  6e 65 74 29 0a 0a 20 20  |.possible with plenty of breaks.........|
+000004b0  67 6f 65 73 20 42 61 6e  |.in-between presentations, this is not..|
+000004c0  6c 65 61 73 68 20 74 68  |.a large event so if you really want....|
+000004d0  77 65 72 29 0a 0a 20 20  |.to speak with somebody they should be..|
+000004e0  6f 74 68 20 4c 6f 77 20  |.easy to locate.........................|
+000004f0  6f 72 20 47 6f 6f 64 20  |........................................|
+00000500  20 74 68 65 20 74 68 69  |.confirmed presentations in more detail.|
+00000510  2a 20 52 45 42 4f 4f 54  |.are available on github:...............|
+00000520  20 28 6d 61 6b 69 6e 67  |.> https://github.com/squatconf/talks ..|
+00000530  70 74 6f 20 76 69 61 62  |........................................|
+00000540  20 54 72 61 6e 73 6d 69  | there are several valid reasons why we.|
+00000550  44 54 20 61 20 666 1 73  | will strongly discourage all types of..|
+00000560  6f 6c 29 0a 0a 20 20 2a  | recording at the event, that means.....|
+00000570  20 43 72 79 70 74 6f 20  | video, audio and photography, as well..|
+00000580  74 72 61 6c 69 7a 65 64  | as any other formats that exist. this..|
+00000590  72 65 76 6f 6c 75 74 69  | is primarily so that people can speak..|
+000005a0  69 73 20 77 69 6c 6c 20  | their minds and not be held accountable|
+000005b0  65 20 74 72 61 63 6b 20  | for the rest of eternity, if you are...|
+000005c0  74 61 6c 6b 73 20 77 69  | doing any kind of recording inside the.|
+000005d0  6f 75 74 20 32 35 20 6d  | venue you must obtain explicit consent.|
+000005e0  61 63 68 0a 62 75 74 20  | from all affected persons prior to.....|
+000005f0  20 62 65 20 6c 6f 6e 67  | recording, we are serious about this...|
+00000600  6f 20 35 30 20 6d 69 6e  |........................................|
+00000610  65 20 77 69 6c 6c 20 74  | it also means that if you are not in...|
+00000620  65 61 74 65 20 61 73 0a  | attendance, you *really* do miss it,...|
+00000630  6f 72 74 75 6e 69 74 69  | so please, be there, in person and.....|
+00000640  6f 6e 76 65 72 73 61 74  | enjoy the experience with us...........|
+00000650  6f 73 73 69 62 6c 65 20  |........................................|
+00000666  6e 74 79 20 6f 66 20 62  | regarding entry and tickets, this is...|
+00000670  6e 2d 62 65 74 77 65 65  | an open event accessible to everyone...|
+00000680  74 61 74 69 6f 6e 73 2c  | you will not need a ticket, if you are.|
+00000690  20 6e 6f 74 20 61 20 6c  | there you will get in, simple as that..|
+000006a0  6e 74 20 73 6f 20 69 66  |........................................|
+000006b0  6c 6c 79 20 0a 77 61 6e  |............see you in Paris............|
+000006c0  61 6b 20 77 69 74 68 20  |........................................|
+000006d0  20 74 68 65 79 20 73 68  |............(squatConf team)............|
+000006e0  65 61 73 79 20 74 6f 20  |........................................|
+000006f0  09 20 0a 63 6f 6e 666 9  6f 75 6c 64 20 62 65 20  20 6f 76 65 72 20
+00000700  73 65 6e 74 61 74 69 6f  6c 6f 63 61 74 65 2e 0a  20 63 6f 6e 76 65
+00000710  72 65 20 64 65 74 61 69  72 6d 65 64 20 70 72 65  31 20 64 61 79 0a
+00000720  61 69 6c 61 62 6c 65 20  6e 73 20 69 6e 20 6d 6f  6e 6f 77 6c 65 64
+00000730  62 3a 0a 3e 20 68 74 74  6c 20 61 72 65 20 61 76  69 61 6c 69 7a 65
+00000740  68 75 62 2e 63 6f 6d 2f  6f 6e 20 67 69 74 68 75  20 6d 69 6e 64 65
+00000750  66 2f 74 61 6c 6b 73 2f  70 73 3a 2f 2f 67 69 74  61 6c 73 2c 20 74
+00000760  74 65 72 2f 63 6f 6e 666  3 71 75 61 74 63 6f 6e  68 61 73 20 73 6f