1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

added mail project for designing mail templates

This commit is contained in:
Kyle Spearrin 2016-10-06 19:12:16 -04:00
parent c954683133
commit 1dabed975e
13 changed files with 558 additions and 1 deletions

1
.gitignore vendored
View File

@ -199,3 +199,4 @@ FakesAssemblies/
# Other
project.lock.json
*.jfm
mail_dist/

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}"
EndProject
@ -19,6 +19,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Api", "src\Api\Api.xproj",
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "Sql", "src\Sql\Sql.sqlproj", "{58554E52-FDEC-4832-AFF9-302B01E08DCA}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Mail", "src\Mail\Mail.xproj", "{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -39,6 +41,10 @@ Global
{58554E52-FDEC-4832-AFF9-302B01E08DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58554E52-FDEC-4832-AFF9-302B01E08DCA}.Release|Any CPU.Build.0 = Release|Any CPU
{58554E52-FDEC-4832-AFF9-302B01E08DCA}.Release|Any CPU.Deploy.0 = Release|Any CPU
{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -47,5 +53,6 @@ Global
{3973D21B-A692-4B60-9B70-3631C057423A} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}
{E8548AD6-7FB0-439A-8EB5-549A10336D2D} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}
{58554E52-FDEC-4832-AFF9-302B01E08DCA} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}
{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}
EndGlobalSection
EndGlobal

23
src/Mail/Mail.xproj Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>b78a6c74-1a24-48c6-802a-13be3e4daff1</ProjectGuid>
<RootNamespace>Bit.Mail</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<DnxInvisibleContent Include="bower.json" />
<DnxInvisibleContent Include=".bowerrc" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

20
src/Mail/Program.cs Normal file
View File

@ -0,0 +1,20 @@
using System.IO;
using Microsoft.AspNetCore.Hosting;
namespace Bit.Mail
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}

View File

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:33104/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Mail": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5004",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

16
src/Mail/Startup.cs Normal file
View File

@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace Bit.Mail
{
public class Startup
{
public void ConfigureServices(IServiceCollection services) { }
public void Configure(IApplicationBuilder app)
{
app.UseFileServer();
app.UseBrowserLink();
}
}
}

20
src/Mail/gulpfile.js Normal file
View File

@ -0,0 +1,20 @@
/// <binding BeforeBuild='build, dist' Clean='clean' ProjectOpened='build. dist' />
var gulp = require('gulp'),
rimraf = require('rimraf'),
premailer = require('gulp-premailer');
var paths = {
dist: '../../mail_dist/',
wwwroot: './wwwroot/'
};
gulp.task('inline', ['clean'], function () {
return gulp.src(paths.wwwroot + 'templates/*.html')
.pipe(premailer())
.pipe(gulp.dest(paths.dist));
});
gulp.task('clean', function (cb) {
return rimraf(paths.dist, cb);
});

9
src/Mail/package.json Normal file
View File

@ -0,0 +1,9 @@
{
"name": "bitwarden",
"version": "0.0.1",
"devDependencies": {
"gulp": "3.9.1",
"rimraf": "2.5.4",
"gulp-premailer": "0.4.0"
}
}

48
src/Mail/project.json Normal file
View File

@ -0,0 +1,48 @@
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"define": [ "DEBUG" ]
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}

20
src/Mail/web.config Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
<appSettings>
<add key="vs:EnableBrowserLink" value="true"/>
</appSettings>
<system.web>
<compilation debug="true"></compilation>
</system.web>
</configuration>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>bitwarden Mail Templates</title>
</head>
<body>
<ol>
<li><a href="templates/welcome.html">Welcome</a></li>
</ol>
</body>
</html>

221
src/Mail/wwwroot/styles.css Normal file
View File

@ -0,0 +1,221 @@
/* -------------------------------------
GLOBAL
A very basic CSS reset
------------------------------------- */
body, html, body * {
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
box-sizing: border-box;
font-size: 14px;
color: #333;
}
img {
max-width: 100%;
border: none;
}
body {
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: none;
width: 100% !important;
height: 100%;
line-height: 22px;
}
/* Let's make sure all tables have defaults */
table td {
vertical-align: top;
}
table td.middle {
vertical-align: middle;
}
/* -------------------------------------
BODY & CONTAINER
------------------------------------- */
body {
background-color: #f6f6f6;
}
.body-wrap {
background-color: #f6f6f6;
width: 100%;
}
.container {
display: block !important;
max-width: 600px !important;
margin: 0 auto !important;
/* makes it centered */
clear: both !important;
}
.content {
max-width: 600px;
margin: 0 auto;
display: block;
padding: 20px;
}
/* -------------------------------------
HEADER, FOOTER, MAIN
------------------------------------- */
.main {
background-color: #fff;
border: 1px solid #e9e9e9;
border-radius: 3px;
}
.content-wrap {
padding: 20px;
}
.content-block {
padding: 0 0 15px;
}
.header {
width: 100%;
margin-bottom: 20px;
}
.footer {
width: 100%;
clear: both;
color: #999;
padding-top: 15px;
}
.footer p, .footer a, .footer td {
color: #999;
font-size: 12px;
}
/* -------------------------------------
TYPOGRAPHY
------------------------------------- */
.h3 {
font-size: 18px;
line-height: 25px;
margin-bottom: 20px;
margin-top: 20px;
}
/* -------------------------------------
LINKS & BUTTONS
------------------------------------- */
a {
color: #3c8dbc;
text-decoration: underline;
}
.btn-primary {
text-decoration: none;
color: #FFF;
background-color: #3c8dbc;
border: solid #3c8dbc;
border-width: 10px 20px;
line-height: 2em;
font-weight: bold;
text-align: center;
cursor: pointer;
display: inline-block;
border-radius: 5px;
text-transform: capitalize;
}
/* -------------------------------------
OTHER STYLES THAT MIGHT BE USEFUL
------------------------------------- */
.last {
margin-bottom: 0;
padding-bottom: 0;
}
.first {
margin-top: 0;
padding-top: 0;
}
.aligncenter {
text-align: center;
}
.alignright {
text-align: right;
}
.alignleft {
text-align: left;
}
.clear {
clear: both;
}
/* -------------------------------------
ALERTS
Change the class depending on warning email, good email or bad email
------------------------------------- */
.alert {
font-size: 16px;
color: #fff;
font-weight: 500;
padding: 20px;
text-align: center;
border-radius: 3px 3px 0 0;
}
.alert a {
color: #fff;
text-decoration: none;
font-weight: 500;
font-size: 16px;
}
.alert.alert-warning {
background-color: #FF9F00;
}
.alert.alert-bad {
background-color: #D0021B;
}
.alert.alert-good {
background-color: #68B90F;
}
/* -------------------------------------
RESPONSIVE AND MOBILE FRIENDLY STYLES
------------------------------------- */
@media only screen and (max-width: 640px) {
body {
padding: 0 !important;
}
.container {
padding: 0 !important;
width: 100% !important;
}
.content {
padding: 0 !important;
}
.content-wrap {
padding: 10px !important;
}
.invoice {
width: 100% !important;
}
.main {
border-right: none !important;
border-left: none !important;
border-radius: 0 !important;
}
}

View File

@ -0,0 +1,133 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Welcome</title>
<link href="../styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<table class="body-wrap">
<tr>
<td class="container" width="600">
<div class="content">
<table class="main" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="content-wrap">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="content-block">
Thank you for creating an account with bitwarden. You may now log in with your new account.
</td>
</tr>
<tr>
<td class="content-block">
Did you know that bitwarden is free to sync with all of your devices? Download bitwarden today on:
</td>
</tr>
<tr>
<td class="h3">
Mobile
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="aligncenter" width="50%">Android</td>
<td class="aligncenter" width="50%">iOS</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="content-block">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" class="aligncenter middle" width="50%">
<a href="https://play.google.com/store/apps/details?id=com.x8bit.bitwarden" title="Get bitwarden on Google Play" target="_blank">
<img src="https://developer.android.com/images/brand/en_generic_rgb_wo_45.png" width="129" height="45" alt="Get bitwarden on Google Play" />
</a>
</td>
<td valign="middle" class="aligncenter middle" width="50%">
<a href="https://itunes.apple.com/us/app/bitwarden-free-password-manager/id1137397744?mt=8" target="_blank" title="Get bitwarden for iOS">
<img src="https://bitwarden.com/images/app-store-badge.png" width="135" height="40" alt="Get bitwarden for iOS" />
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="h3">
Desktop
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="aligncenter" width="33%">Chrome</td>
<td class="aligncenter" width="34%">Firefox</td>
<td class="aligncenter" width="33%">Opera</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="content-block">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" class="aligncenter middle" width="33%">
<a href="https://chrome.google.com/webstore/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb?utm_source=welcome_email&utm_medium=email" title="Get bitwarden for Chrome" target="_blank">
<img width="53" height="54" alt="Chrome Extension" src="https://bitwarden.com/images/chrome.png" />
</a>
</td>
<td valign="middle" class="aligncenter middle" width="34%">
<img width="57" height="54" alt="Firefox Extension" src="https://bitwarden.com/images/firefox.png" />
</td>
<td valign="middle" class="aligncenter middle" width="33%">
<img width="53" height="54" alt="Opera Extension" src="https://bitwarden.com/images/opera.png" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="h3">
Web
</td>
</tr>
<tr>
<td class="content-block">
You can also access your vault from any web-enabled device using our web vault at <a target="_blank" href="https://vault.bitwarden.com/?utm_source=welcome_email&utm_medium=email">https://vault.bitwarden.com</a>.
</td>
</tr>
<tr>
<td class="content-block">
If you have any questions or problems you can email us from our website at <a target="_blank" href="https://bitwarden.com/contact/?utm_source=welcome_email&utm_medium=email">https://bitwarden.com/contact</a>.
</td>
</tr>
<tr>
<td class="content-block last">
&mdash; The bitwarden Team
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="footer">
<table width="100%">
<tr>
<td class="aligncenter content-block">8bit Solutions LLC&lt;%body%&gt;</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
</body>
</html>