Calculate weight by page count, add restricted delivery, add custom mailing date

master
Skylar Ittner 9 months ago
parent 8f34d46c32
commit 74513014d6

@ -1,3 +1,4 @@
auxiliary.org-netbeans-modules-css-prep.sass_2e_configured=true
include.path=${php.global.include.path}
php.version=PHP_82
source.encoding=UTF-8

@ -113,6 +113,20 @@
<input type="text" name="from_zip" placeholder="Your ZIP Code" required />
<input type="email" name="from_email" placeholder="Your Email Address" required />
<br />
<div class="row gtr-uniform">
<div class="col-6 col-12-small">
<h3>Page Count:</h3>
<input type="number" min='1' max='20' name="page_count" placeholder="#" value="" />
<p>We use this to estimate your letter's weight and calculate the correct postage price.</p>
</div>
<div class="col-6 col-12-small">
<h3>Mailing Date:</h3>
<input type="date" name="mailing_date" id="mailing_date" />
<p>Letters should be mailed on the date selected.</p>
</div>
</div>
<br />
<h3>Options:</h3>
<div class="row gtr-uniform">
@ -140,9 +154,14 @@
<label for="postagetype_first"><b>First Class letter</b>
<br />
Make a regular First Class envelope with no tracking, signatures,
or special features. Must weigh no more than 3.5 ounces and be at most 1/4
inch thick. If the contents aren't flexible, it must weigh no more
than 3 ounces.
or special features. Papers only please, nothing bumpy or hard.
</label>
</div>
<div class="col-4 col-12-small">
<input id="restricted_delivery" type="checkbox" name="restricted_delivery" value="restricted_delivery" />
<label for="restricted_delivery"><b>Restricted Delivery</b>
<br />
Only the named recipient or their legal agent will be allowed to sign for and receive the letter.
</label>
</div>
</div>
@ -191,16 +210,8 @@
or slide it into your cluster mailbox's outgoing mail slot.
</p>
<p id="trackingnumberparagraph">Tracking Number: <a target="_BLANK" id="trackingnumber"></a>
<br>You should write this number down or bookmark the tracking link,
we won't show it again after you leave the page.</p>
<p><i class="fal fa-badge-sheriff"></i> Warning: Do not print and mail
multiple copies of the same PDF.
It's fraud, forgery, theft, and a violation of multiple federal laws,
such as 18 U.S. Code § 501, 1001, 1341, 1720, 1725, and 3802.
If two letters with the same barcode are detected by the mail sorting system,
they will be automatically reported to USPIS, the federal postal police.
If your PDF doesn't print correctly, first cancel the misprinted postage by drawing
an X through all the barcodes or destroying the paper, then try printing again.
multiple copies of the same PDF. It's considered counterfeiting and is a violation of federal law.
</p>
<br />
<ul class="actions">

@ -1663,6 +1663,8 @@ label {
input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=date],
select,
textarea {
-moz-appearance: none;
@ -1681,6 +1683,8 @@ textarea {
input[type=text]:invalid,
input[type=password]:invalid,
input[type=email]:invalid,
input[type=number]:invalid,
input[type=date]:invalid,
select:invalid,
textarea:invalid {
box-shadow: none;
@ -1704,6 +1708,8 @@ select::-ms-expand {
input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=date],
select {
height: 3em;
}
@ -1800,6 +1806,8 @@ label {
input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=date],
select,
textarea {
background-color: rgba(99, 116, 133, 0.075);
@ -1808,6 +1816,8 @@ textarea {
input[type=text]:focus,
input[type=password]:focus,
input[type=email]:focus,
input[type=number]:focus,
input[type=date]:focus,
select:focus,
textarea:focus {
border-color: #39a288;
@ -2663,6 +2673,8 @@ table.alt tbody tr td {
.wrapper.style1 input[type=text],
.wrapper.style1 input[type=password],
.wrapper.style1 input[type=email],
.wrapper.style1 input[type=number],
.wrapper.style1 input[type=date],
.wrapper.style1 select,
.wrapper.style1 textarea {
background-color: rgba(0, 0, 0, 0.065);
@ -2671,6 +2683,8 @@ table.alt tbody tr td {
.wrapper.style1 input[type=text]:focus,
.wrapper.style1 input[type=password]:focus,
.wrapper.style1 input[type=email]:focus,
.wrapper.style1 input[type=number]:focus,
.wrapper.style1 input[type=date]:focus,
.wrapper.style1 select:focus,
.wrapper.style1 textarea:focus {
border-color: #ffffff;
@ -2866,6 +2880,8 @@ table.alt tbody tr td {
.wrapper.style2 input[type=text],
.wrapper.style2 input[type=password],
.wrapper.style2 input[type=email],
.wrapper.style2 input[type=number],
.wrapper.style2 input[type=date],
.wrapper.style2 select,
.wrapper.style2 textarea {
background-color: rgba(99, 116, 133, 0.075);
@ -2874,6 +2890,8 @@ table.alt tbody tr td {
.wrapper.style2 input[type=text]:focus,
.wrapper.style2 input[type=password]:focus,
.wrapper.style2 input[type=email]:focus,
.wrapper.style2 input[type=number]:focus,
.wrapper.style2 input[type=date]:focus,
.wrapper.style2 select:focus,
.wrapper.style2 textarea:focus {
border-color: #39a288;
@ -3562,6 +3580,8 @@ body.is-preload #banner:after {
#footer form input[type=text],
#footer form input[type=password],
#footer form input[type=email],
#footer form input[type=number],
#footer form input[type=date],
#footer form select,
#footer form textarea {
background-color: rgba(0, 0, 0, 0.065);
@ -3570,6 +3590,8 @@ body.is-preload #banner:after {
#footer form input[type=text]:focus,
#footer form input[type=password]:focus,
#footer form input[type=email]:focus,
#footer form input[type=number]:focus,
#footer form input[type=date]:focus,
#footer form select:focus,
#footer form textarea:focus {
border-color: #ffffff;

File diff suppressed because one or more lines are too long

@ -188,4 +188,12 @@ $("#startOverButton").on("click", function () {
location.hash = 'label';
location.reload();
}
});
});
var mailingdate = new Date();
mailingdate.setDate(mailingdate.getDate() + 1 /*days*/);
$("#mailing_date").val(mailingdate.toISOString().split('T')[0]);
$("#mailing_date").prop("min", (new Date()).toISOString().split('T')[0]);
var datemax = new Date();
datemax.setDate(datemax.getDate() + 14 /*days*/);
$("#mailing_date").prop("max", datemax.toISOString().split('T')[0]);

@ -6,295 +6,301 @@
/* Form */
form {
margin: 0 0 _size(element-margin) 0;
> :last-child {
margin-bottom: 0;
}
> .fields {
$gutter: (_size(element-margin) * 0.75);
@include vendor('display', 'flex');
@include vendor('flex-wrap', 'wrap');
width: calc(100% + #{$gutter * 2});
margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1);
> .field {
@include vendor('flex-grow', '0');
@include vendor('flex-shrink', '0');
padding: $gutter 0 0 $gutter;
width: calc(100% - #{$gutter * 1});
&.half {
width: calc(50% - #{$gutter * 0.5});
}
&.third {
width: calc(#{100% / 3} - #{$gutter * (1 / 3)});
}
&.quarter {
width: calc(25% - #{$gutter * 0.25});
}
}
}
@include breakpoint('<=xsmall') {
> .fields {
$gutter: (_size(element-margin) * 0.75);
width: calc(100% + #{$gutter * 2});
margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1);
> .field {
padding: $gutter 0 0 $gutter;
width: calc(100% - #{$gutter * 1});
&.half {
width: calc(100% - #{$gutter * 1});
}
&.third {
width: calc(100% - #{$gutter * 1});
}
&.quarter {
width: calc(100% - #{$gutter * 1});
}
}
}
}
}
label {
display: block;
font-size: 0.9em;
font-weight: _font(weight-bold);
margin: 0 0 (_size(element-margin) * 0.5) 0;
}
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
@include vendor('appearance', 'none');
border: none;
border: solid _size(border-width);
color: inherit;
display: block;
outline: 0;
padding: 0 1em;
text-decoration: none;
width: 100%;
&:invalid {
box-shadow: none;
}
}
select {
background-size: 1.25rem;
background-repeat: no-repeat;
background-position: calc(100% - 1rem) center;
height: _size(element-height);
padding-right: _size(element-height);
text-overflow: ellipsis;
&:focus {
&::-ms-value {
background-color: transparent;
}
}
&::-ms-expand {
display: none;
}
}
input[type="text"],
input[type="password"],
input[type="email"],
select {
height: _size(element-height);
}
textarea {
padding: 0.75em 1em;
}
input[type="checkbox"],
input[type="radio"], {
@include vendor('appearance', 'none');
display: block;
float: left;
margin-right: -2em;
opacity: 0;
width: 1em;
z-index: -1;
& + label {
@include icon(false, solid);
cursor: pointer;
display: inline-block;
font-size: 1em;
font-weight: _font(weight);
padding-left: (_size(element-height) * 0.6) + 0.75em;
padding-right: 0.75em;
position: relative;
&:before {
border-radius: _size(border-radius);
border: solid _size(border-width);
content: '';
display: inline-block;
font-size: 0.8em;
height: (_size(element-height) * 0.6);
left: 0;
line-height: (_size(element-height) * 0.575);
position: absolute;
text-align: center;
top: 0;
width: (_size(element-height) * 0.6);
}
}
&:checked + label {
&:before {
content: '\f00c';
}
}
}
input[type="checkbox"] {
& + label {
&:before {
border-radius: _size(border-radius);
}
}
}
input[type="radio"] {
& + label {
&:before {
border-radius: 100%;
}
}
}
::-webkit-input-placeholder {
opacity: 1.0;
}
:-moz-placeholder {
opacity: 1.0;
}
::-moz-placeholder {
opacity: 1.0;
}
:-ms-input-placeholder {
opacity: 1.0;
}
@mixin color-form($p: null) {
$highlight: _palette($p, highlight);
label {
color: _palette($p, fg-bold);
}
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
background-color: _palette($p, border2-bg);
border-color: transparent;
&:focus {
@if $p == $highlight {
border-color: _palette($p, fg-bold);
box-shadow: 0 0 0 _size(border-width) _palette($p, fg-bold);
}
@else {
border-color: _palette(accent1, bg);
box-shadow: 0 0 0 _size(border-width) _palette(accent1, bg);
}
}
}
select {
background-image: svg-url("<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'><path d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='#{_palette($p, border)}' /></svg>");
option {
color: _palette($p, fg-bold);
background: _palette($p, bg);
}
}
input[type="checkbox"],
input[type="radio"], {
& + label {
color: _palette($p, fg);
&:before {
background: _palette($p, border2-bg);
border-color: _palette($p, border);
}
}
&:checked + label {
&:before {
@if $p == $highlight {
background-color: _palette($p, fg-bold);
border-color: _palette($p, fg-bold);
color: _palette($p, bg);
}
@else {
background-color: _palette(accent1, bg);
border-color: _palette(accent1, bg);
color: _palette(accent1, fg-bold);
}
}
}
&:focus + label {
&:before {
@if $p == $highlight {
border-color: _palette($p, fg-bold);
box-shadow: 0 0 0 _size(border-width) _palette($p, fg-bold);
}
@else {
border-color: _palette(accent1, bg);
box-shadow: 0 0 0 _size(border-width) _palette(accent1, bg);
}
}
}
}
::-webkit-input-placeholder {
color: _palette($p, fg-light) !important;
}
:-moz-placeholder {
color: _palette($p, fg-light) !important;
}
::-moz-placeholder {
color: _palette($p, fg-light) !important;
}
:-ms-input-placeholder {
color: _palette($p, fg-light) !important;
}
.formerize-placeholder {
color: _palette($p, fg-light) !important;
}
}
@include color-form;
form {
margin: 0 0 _size(element-margin) 0;
> :last-child {
margin-bottom: 0;
}
> .fields {
$gutter: (_size(element-margin) * 0.75);
@include vendor('display', 'flex');
@include vendor('flex-wrap', 'wrap');
width: calc(100% + #{$gutter * 2});
margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1);
> .field {
@include vendor('flex-grow', '0');
@include vendor('flex-shrink', '0');
padding: $gutter 0 0 $gutter;
width: calc(100% - #{$gutter * 1});
&.half {
width: calc(50% - #{$gutter * 0.5});
}
&.third {
width: calc(#{100% / 3} - #{$gutter * (1 / 3)});
}
&.quarter {
width: calc(25% - #{$gutter * 0.25});
}
}
}
@include breakpoint('<=xsmall') {
> .fields {
$gutter: (_size(element-margin) * 0.75);
width: calc(100% + #{$gutter * 2});
margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1);
> .field {
padding: $gutter 0 0 $gutter;
width: calc(100% - #{$gutter * 1});
&.half {
width: calc(100% - #{$gutter * 1});
}
&.third {
width: calc(100% - #{$gutter * 1});
}
&.quarter {
width: calc(100% - #{$gutter * 1});
}
}
}
}
}
label {
display: block;
font-size: 0.9em;
font-weight: _font(weight-bold);
margin: 0 0 (_size(element-margin) * 0.5) 0;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
@include vendor('appearance', 'none');
border: none;
border: solid _size(border-width);
color: inherit;
display: block;
outline: 0;
padding: 0 1em;
text-decoration: none;
width: 100%;
&:invalid {
box-shadow: none;
}
}
select {
background-size: 1.25rem;
background-repeat: no-repeat;
background-position: calc(100% - 1rem) center;
height: _size(element-height);
padding-right: _size(element-height);
text-overflow: ellipsis;
&:focus {
&::-ms-value {
background-color: transparent;
}
}
&::-ms-expand {
display: none;
}
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
height: _size(element-height);
}
textarea {
padding: 0.75em 1em;
}
input[type="checkbox"],
input[type="radio"], {
@include vendor('appearance', 'none');
display: block;
float: left;
margin-right: -2em;
opacity: 0;
width: 1em;
z-index: -1;
& + label {
@include icon(false, solid);
cursor: pointer;
display: inline-block;
font-size: 1em;
font-weight: _font(weight);
padding-left: (_size(element-height) * 0.6) + 0.75em;
padding-right: 0.75em;
position: relative;
&:before {
border-radius: _size(border-radius);
border: solid _size(border-width);
content: '';
display: inline-block;
font-size: 0.8em;
height: (_size(element-height) * 0.6);
left: 0;
line-height: (_size(element-height) * 0.575);
position: absolute;
text-align: center;
top: 0;
width: (_size(element-height) * 0.6);
}
}
&:checked + label {
&:before {
content: '\f00c';
}
}
}
input[type="checkbox"] {
& + label {
&:before {
border-radius: _size(border-radius);
}
}
}
input[type="radio"] {
& + label {
&:before {
border-radius: 100%;
}
}
}
::-webkit-input-placeholder {
opacity: 1.0;
}
:-moz-placeholder {
opacity: 1.0;
}
::-moz-placeholder {
opacity: 1.0;
}
:-ms-input-placeholder {
opacity: 1.0;
}
@mixin color-form($p: null) {
$highlight: _palette($p, highlight);
label {
color: _palette($p, fg-bold);
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
background-color: _palette($p, border2-bg);
border-color: transparent;
&:focus {
@if $p == $highlight {
border-color: _palette($p, fg-bold);
box-shadow: 0 0 0 _size(border-width) _palette($p, fg-bold);
}
@else {
border-color: _palette(accent1, bg);
box-shadow: 0 0 0 _size(border-width) _palette(accent1, bg);
}
}
}
select {
background-image: svg-url("<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'><path d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='#{_palette($p, border)}' /></svg>");
option {
color: _palette($p, fg-bold);
background: _palette($p, bg);
}
}
input[type="checkbox"],
input[type="radio"], {
& + label {
color: _palette($p, fg);
&:before {
background: _palette($p, border2-bg);
border-color: _palette($p, border);
}
}
&:checked + label {
&:before {
@if $p == $highlight {
background-color: _palette($p, fg-bold);
border-color: _palette($p, fg-bold);
color: _palette($p, bg);
}
@else {
background-color: _palette(accent1, bg);
border-color: _palette(accent1, bg);
color: _palette(accent1, fg-bold);
}
}
}
&:focus + label {
&:before {
@if $p == $highlight {
border-color: _palette($p, fg-bold);
box-shadow: 0 0 0 _size(border-width) _palette($p, fg-bold);
}
@else {
border-color: _palette(accent1, bg);
box-shadow: 0 0 0 _size(border-width) _palette(accent1, bg);
}
}
}
}
::-webkit-input-placeholder {
color: _palette($p, fg-light) !important;
}
:-moz-placeholder {
color: _palette($p, fg-light) !important;
}
::-moz-placeholder {
color: _palette($p, fg-light) !important;
}
:-ms-input-placeholder {
color: _palette($p, fg-light) !important;
}
.formerize-placeholder {
color: _palette($p, fg-light) !important;
}
}
@include color-form;

@ -26,6 +26,10 @@ try {
throw new Exception("Please enter your ZIP code, or if you don't know, enter your city and state and we'll find the ZIP code for you.");
}
if (empty($_REQUEST["from_email"]) || !filter_var($_REQUEST["from_email"], FILTER_VALIDATE_EMAIL)) {
throw new Exception("Please enter your email address. We use it to send you a receipt with your tracking number and other info. You won't get any spam emails, we promise.");
}
$shipmentinfo["from_address"] = \EasyPost\Address::create([
"verify" => array("delivery"),
"name" => $_REQUEST["from_name"],
@ -50,12 +54,25 @@ try {
"country" => "US"
]);
$weight = 3.5;
if (!empty($_REQUEST["page_count"]) && is_numeric($_REQUEST["page_count"])) {
// about 5 pages per ounce
$weight = ($_REQUEST["page_count"] * 1 + 1) / 5;
}
if ($weight > 3.5) {
throw new Exception("Too many pages to send as a letter.");
}
$shipmentinfo["parcel"] = \EasyPost\Parcel::create([
"predefined_package" => "Letter",
"weight" => 3.5
"weight" => $weight
]);
$shipmentinfo["carrier_accounts"] = [$_SETTINGS["easypost_usps_account"]]; // USPS
if (empty($_SETTINGS["test"]) || $_SETTINGS["test"] != true) {
$shipmentinfo["carrier_accounts"] = [$_SETTINGS["easypost_usps_account"]]; // USPS
}
if ($_REQUEST["postagetype"] == "certified") {
$shipmentinfo["options"]["certified_mail"] = true;
@ -64,10 +81,32 @@ try {
$shipmentinfo["options"]["return_receipt"] = true;
}
if ($_REQUEST["restricted_delivery"] == "restricted_delivery") {
if (!empty($shipmentinfo["options"]["certified_mail"]) && $shipmentinfo["options"]["certified_mail"] == true) {
$shipmentinfo["options"]["delivery_confirmation"] = "SIGNATURE_RESTRICTED";
} else {
throw new Exception("Restricted Delivery is only available with Certified Mail.");
}
}
$shipmentinfo["options"]["label_format"] = "PNG";
$shipmentinfo["options"]["label_size"] = "7x3";
$shipmentinfo["options"]["label_date"] = date("c", strtotime("tomorrow"));
$mailing_date = date("c", strtotime("tomorrow"));
if (!empty($_REQUEST["mailing_date"])) {
if (!preg_match("/^20(2[3-9]|[3-4][0-9])-(0[1-9]|1[0-2])-([0-2][0-9]|3[0-1])$/", $_REQUEST["mailing_date"])) {
throw new Exception("Invalid mailing date.");
}
if (strtotime($_REQUEST["mailing_date"]) < strtotime(date("Y-m-d"))) {
throw new Exception("Mailing date cannot be in the past.");
}
if (strtotime($_REQUEST["mailing_date"]) > strtotime("now + 14 days")) {
throw new Exception("Mailing date must be sooner than two weeks from now.");
}
$mailing_date = date("c", strtotime($_REQUEST["mailing_date"]));
}
$shipmentinfo["options"]["label_date"] = $mailing_date;
$shipment = \EasyPost\Shipment::create($shipmentinfo);

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

@ -15,7 +15,7 @@
id="svg8"
inkscape:version="1.0.2 (1.0.2+r75+1)"
sodipodi:docname="papertemplate.svg"
inkscape:export-filename="/home/skylar/Documents/Projects/Websites/certifiedfromhome.com/source/static/papertemplate.png"
inkscape:export-filename="/home/skylar/Documents/Projects/Websites/certifiedfromhome.com/source/static/papertemplate-restricted.png"
inkscape:export-xdpi="300"
inkscape:export-ydpi="300">
<defs
@ -27,11 +27,11 @@
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="605.94598"
inkscape:cy="709.60408"
inkscape:zoom="0.98994949"
inkscape:cx="480.49516"
inkscape:cy="347.11267"
inkscape:document-units="in"
inkscape:current-layer="g1647"
inkscape:current-layer="layer1"
showgrid="false"
units="in"
inkscape:measure-start="24,480"
@ -180,21 +180,48 @@
style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.59000007, 1.59000007;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
<text
transform="scale(-1)"
id="text1051"
y="-199.13943"
x="-107.9212"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52778px;line-height:100%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;text-align:center;letter-spacing:0.264583px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
id="tspan1184"
style="font-size:3.52778px;text-align:center;text-anchor:middle;stroke-width:0.264583px"
y="-199.13943"
x="-107.78891"
sodipodi:role="line">CertifiedFromHome.com</tspan></text>
<g
id="g1647"
transform="translate(-3.4996122e-6,3.6413824)">
id="g1448-3"
transform="matrix(1.1078122,0,0,1.1123464,-1.8206224,-13.634277)"
style="display:inline;stroke-width:0.900842"
inkscape:export-xdpi="300.79999"
inkscape:export-ydpi="300.79999">
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#d90000;stroke-width:0.900842;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1436-6"
width="44.955303"
height="16.225117"
x="25.021935"
y="131.28581" />
<text
transform="scale(-1)"
id="text1051"
y="-195.49805"
x="-107.9212"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52778px;line-height:100%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;text-align:center;letter-spacing:0.264583px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
id="tspan1184"
style="font-size:3.52778px;text-align:center;text-anchor:middle;stroke-width:0.264583px"
y="-195.49805"
x="-107.78891"
sodipodi:role="line">CertifiedFromHome.com</tspan></text>
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:24px;line-height:1;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:center;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:0.999999px;word-spacing:0px;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:middle;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;vector-effect:none;fill:#d90000;fill-opacity:1;stroke:#d90000;stroke-width:0.902256;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000"
x="-55.009407"
y="696.90106"
id="text1432-7"
transform="matrix(0.26458333,0,0,0.26458333,62.099336,-45.939357)"><tspan
sodipodi:role="line"
id="tspan1430-5"
x="-55.009411"
y="696.90106"
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:24px;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu Medium';text-align:center;text-anchor:middle;fill:#d90000;fill-opacity:1;stroke:#d90000;stroke-width:0.902256;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">RESTRICTED</tspan><tspan
sodipodi:role="line"
x="-54.509407"
y="720.90106"
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:24px;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu Medium';text-align:center;text-anchor:middle;fill:#d90000;fill-opacity:1;stroke:#d90000;stroke-width:0.902256;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1434-3">DELIVERY</tspan></text>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 102 KiB

@ -63,6 +63,12 @@ try {
// copy postage label image into page template
imagecopyresampled($paperimage, $labelimage, 225, 750, 0, 0, 2100, 900, 2100, 900);
// Add restricted delivery "stamp"
if ($shipment->options->delivery_confirmation == "SIGNATURE_RESTRICTED") {
$restrictedstamp = imagecreatefrompng(__DIR__ . "/restricted_delivery.png");
imagecopyresampled($paperimage, $restrictedstamp, 300, 1400, 0, 0, 600, 225, 600, 225);
}
} else {
// load page template
$paperimage = imagecreatefrompng(__DIR__ . "/papertemplate_notracking.png");
@ -109,7 +115,7 @@ try {
. "email you a PDF proof of delivery with the recipient's signature and other info.\r\n\r\n";
}
$body .= "Here's a link to your purchased postage, just in case: https://certifiedfromhome.com/pdf/" . $pdffile
. " Please note that while you can print it more than once, mailing multiple copies is illegal.\r\n";
. "\r\nPlease note that while you can print it more than once, mailing multiple copies is illegal.\r\n";
$body .= "If you need any help, just reply to this email. Thanks again!";
$mail->setBody($body);
$mail->send();

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="192"
height="72"
viewBox="0 0 50.8 19.049999"
version="1.1"
id="svg1471"
inkscape:version="1.0.2 (1.0.2+r75+1)"
sodipodi:docname="restricted_delivery.svg"
inkscape:export-filename="/home/skylar/Documents/Projects/Websites/certifiedfromhome.com/source/static/restricted_delivery.png"
inkscape:export-xdpi="300"
inkscape:export-ydpi="300">
<defs
id="defs1465" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="-26.877127"
inkscape:cy="15.979367"
inkscape:document-units="px"
inkscape:current-layer="g1448"
inkscape:document-rotation="0"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1013"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata1468">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-383.86293,-131.63374)">
<g
id="g1448"
transform="matrix(1.1078122,0,0,1.1123464,356.64231,-13.900537)"
style="display:inline;stroke-width:0.900842"
inkscape:export-xdpi="300.79999"
inkscape:export-ydpi="300.79999">
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#d90000;stroke-width:0.900842;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1436"
width="44.955303"
height="16.225117"
x="25.021935"
y="131.28581" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:24px;line-height:1;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;font-variation-settings:normal;text-indent:0;text-align:center;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:0.999999px;word-spacing:0px;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:middle;white-space:normal;shape-padding:0;shape-margin:0;inline-size:0;vector-effect:none;fill:#d90000;fill-opacity:1;stroke:#d90000;stroke-width:0.902256;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000"
x="-55.009407"
y="696.90106"
id="text1432"
transform="matrix(0.26458333,0,0,0.26458333,62.099336,-45.939357)"><tspan
sodipodi:role="line"
id="tspan1430"
x="-55.009411"
y="696.90106"
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:24px;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu Medium';text-align:center;text-anchor:middle;fill:#d90000;fill-opacity:1;stroke:#d90000;stroke-width:0.902256;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">RESTRICTED</tspan><tspan
sodipodi:role="line"
x="-54.509407"
y="720.90106"
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:24px;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu Medium';text-align:center;text-anchor:middle;fill:#d90000;fill-opacity:1;stroke:#d90000;stroke-width:0.902256;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="tspan1434">DELIVERY</tspan></text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

Loading…
Cancel
Save