<commit_before>'use strict';

var express = require('express');
var app = express();
var Postcard = require('../models/postcard');
var State = require('../models/state');
var Lob = require('lob')('test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc');

app.post('/postcard', function(req, res) {
    State.findOne({'State': req.body.state}, function(err, party) {
        Lob.postcards.create({
            description: 'Postcard to Power',
            to: {
                name: party.name,
                address_line1: party.street_address,
                address_city: party.city,
                address_state: party.state,
                address_zip: party.zip
            },
            from: {
                name: req.body.name,
                address_line1: req.body.street_address,
                address_city: req.body.city,
                address_state: req.body.state,
                address_zip: req.body.zip
            }
            front: '<html style="padding: 1in; font-size: 50;">Front HTML for {{name}}.  Message is {{message}}.</html>',
            back: '<html style="padding: 1in; font-size: 20;">Back HTML for {{name}}</html>',
            data: {
                name: req.body.candidate,
                message: req.body.messages
            }
        }, function(err, res) {
            console.log(err, res);
        });
    });

});




module.exports = app;<commit_msg>modified postcard route<commit_after>'use strict';

var express = require('express');
var app = express();
var Postcard = require('../models/postcard');
var State = require('../models/state');
var Lob = require('lob')('test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc');

app.post('/postcard', function(req, res) {
    State.findOne({'State': req.body.state}, function(err, party) {
        Lob.postcards.create({
            description: 'Postcard to Power',
            to: {
                name: party.name,
                address_line1: party.street_address,
                address_city: party.city,
                address_state: party.state,
                address_zip: party.zip
            },
            from: {
                name: req.body.name,
                address_line1: req.body.street_address,
                address_city: req.body.city,
                address_state: req.body.state,
                address_zip: req.body.zip
            },
            front: '<html style="padding: 1in; font-size: 50;">Front HTML for {{name}}.  Message is {{message}}.</html>',
            back: '<html style="padding: 1in; font-size: 20;">Back HTML for {{name}}</html>',
            data: {
                name: req.body.candidate,
                message: req.body.messages
            }
        }, function(err, res) {
            console.log(err, res);
        });
    });

});




module.exports = app;
{'fraction_non_alphanumeric': 0.14194236926360726, 'fraction_numerical': 0.017787264318747775, 'mean_word_length': 1.8318227593152066, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2182187', 'n_tokens_mistral': 868, 'n_tokens_neox': 806, 'n_words': 167}