Skip to content

Instantly share code, notes, and snippets.

Created February 28, 2013 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5053919 to your computer and use it in GitHub Desktop.
Save anonymous/5053919 to your computer and use it in GitHub Desktop.
<head>
<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>cmon!work</title>
<meta name="description" content="casual app">
<meta name="author" content="ghostrunners">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- CSS
================================================== -->
<link rel="stylesheet" type="text/css" href="base.css">
<link rel="stylesheet" href="skeleton.css">
<link rel="stylesheet" href="layout.css">
<link rel="stylesheet" href="client.css">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="apple-touch-icon-114x114.png">
</head>
<body>
{{> page}}
</body>
<template name="page">
<!-- Delete everything in this .container and get started on your own site! -->
<div class="container">
<div class="sixteen columns header">
<h2 class="remove-bottom" style="float:left;">Cmon!</h2>
<hr />
</div>
<div class="12 columns">
{{> form}}
</div>
</div><!-- container -->
</template>
<template name="form">
<h3 style="margin-bottom: 25px;">Peter Piper Picked a Pickled Pepper.</h3>
<form action="">
<label for="from">From</label>
<input type="text" id="from" placeholder="Your email address" />
<label for="to">To</label>
<input type="text" id="to" placeholder="Their email address" />
<label for="subj">Subject</label>
<input type="text" id="subj" placeholder="The mighty Casey will strike out" />
<label for="msg">Message</label>
<input type="text" id="msg" placeholder="Cookier Jar is full." />
<button type="submit" class="submit btn-success">Go!</button>
</form>
</template>
// client
Template.form.events({
'click .submit' : function (event, template) {
var from = template.find("#from").value;
var to = template.find("#to").value;
var subj = template.find("#subj").value;
var msg = template.find("#msg").value;
var options = { from:from, to:to, subj:subj, msg: msg };
if (from.length) {
Meteor.call('send_message', options, function(err, data) {
if (err)
console.log(err);
});
}
}
});
project1/
/.meteor
/client
>client.js
>client.html
>client.css
>base.css
>skeleton.css
>layout.css
/lib
>readme.txt
/public
>favicon.ico
/server
>server.js
/model.js
/*
Meteor.methods({
send_message: function (options) {
var options = options || {};
Email.send({
from: options.from,
to: options.to,
replyTo: options.from || undefined,
subject: options.subj,
text: options.msg,
});
},
});
var send_message = function (from, to, subj, msg) {
Email.send({
from: from,
to: to,
replyTo: from || undefined,
subject: subj,
text: msg,
});
};*/
# Meteor packages used by this project, one per line.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
preserve-inputs
accounts-ui
accounts-password
bootstrap
email<head>
<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>cmon!work</title>
<meta name="description" content="casual app">
<meta name="author" content="ghostrunners">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- CSS
================================================== -->
<link rel="stylesheet" type="text/css" href="base.css">
<link rel="stylesheet" href="skeleton.css">
<link rel="stylesheet" href="layout.css">
<link rel="stylesheet" href="cmonbetme.css">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="apple-touch-icon-114x114.png">
</head>
<body>
{{> page}}
</body>
<template name="page">
<!-- Delete everything in this .container and get started on your own site! -->
<div class="container">
<div class="sixteen columns header">
<h2 class="remove-bottom" style="float:left;">Cmon!</h2>
<hr />
</div>
<div class="12 columns">
{{> form}}
</div>
</div><!-- container -->
</template>
<template name="form">
<h3 style="margin-bottom: 25px;">Peter Piper Picked a Pickled Pepper.</h3>
<form action="">
<label for="from">You</label>
<input type="text" id="from" placeholder="Your email address" />
<label for="to">Them</label>
<input type="text" id="to" placeholder="Their email address" />
<label for="subj">Subject</label>
<input type="text" id="subj" placeholder="The mighty Casey will strike out" />
<label for="msg">Message</label>
<input type="text" id="msg" placeholder="Cookier Jar is full." />
<button type="submit" class="submit btn-success">Go!</button>
</form>
</template>
// server
Meteor.startup(function () {
process.env.MAIL_URL = 'smtp://postmaster%40<XYZ>.mailgun.org:<123>@smtp.mailgun.org:587';
});
Meteor.methods({
send_message: function (options) {
var options = options || {};
Email.send({
from: options.from,
to: options.to,
replyTo: options.from || undefined,
subject: options.subj,
text: options.msg,
});
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment