mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
add envelope to email node options
as part of node-red#875
This commit is contained in:
parent
34c42eed61
commit
b23cf0b788
@ -77,6 +77,7 @@
|
|||||||
The filename should be set using <code>msg.filename</code>. Optionally <code>msg.description</code> can be added for the body text.</p>
|
The filename should be set using <code>msg.filename</code>. Optionally <code>msg.description</code> can be added for the body text.</p>
|
||||||
<p>Alternatively you may provide <code>msg.attachments</code> which should contain an array of one or
|
<p>Alternatively you may provide <code>msg.attachments</code> which should contain an array of one or
|
||||||
more attachments in <a href="https://www.npmjs.com/package/nodemailer#attachments" target="_new">nodemailer</a> format.</p>
|
more attachments in <a href="https://www.npmjs.com/package/nodemailer#attachments" target="_new">nodemailer</a> format.</p>
|
||||||
|
<p>If required by your recipient you may also pass in a <code>msg.envelope</code> object, typically containing extra from and to properties.</p>
|
||||||
<p>Note: uses SMTP with SSL to port 465.</p>
|
<p>Note: uses SMTP with SSL to port 465.</p>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -178,13 +179,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$("#node-input-useSSL").change(function(x, y) {
|
$("#node-input-useSSL").change(function(x, y) {
|
||||||
console.log("useSSL: x="+ JSON.stringify(x) + ", y=" + y);
|
console.log("useSSL: x="+ JSON.stringify(x) + ", y=" + y);
|
||||||
console.log("Value: " + $("#node-input-useSSL").prop("checked"));
|
console.log("Value: " + $("#node-input-useSSL").prop("checked"));
|
||||||
checkPorts();
|
checkPorts();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#node-input-protocol").change(function() {
|
$("#node-input-protocol").change(function() {
|
||||||
var protocol = $("#node-input-protocol").val();
|
var protocol = $("#node-input-protocol").val();
|
||||||
if (protocol === "IMAP") {
|
if (protocol === "IMAP") {
|
||||||
@ -192,7 +193,7 @@
|
|||||||
$(".node-input-disposition").show();
|
$(".node-input-disposition").show();
|
||||||
} else {
|
} else {
|
||||||
$(".node-input-box").hide();
|
$(".node-input-box").hide();
|
||||||
$(".node-input-disposition").hide();
|
$(".node-input-disposition").hide();
|
||||||
}
|
}
|
||||||
checkPorts();
|
checkPorts();
|
||||||
});
|
});
|
||||||
@ -210,7 +211,7 @@
|
|||||||
<p>Note: uses IMAP with SSL to port 993.</p>
|
<p>Note: uses IMAP with SSL to port 993.</p>
|
||||||
<p>Any attachments supplied in the incoming email can be found in the <code>msg.attachments</code> property. This will be an array of objects where
|
<p>Any attachments supplied in the incoming email can be found in the <code>msg.attachments</code> property. This will be an array of objects where
|
||||||
each object represents a specific attachments. The format of the object is:</p>
|
each object represents a specific attachments. The format of the object is:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
{
|
{
|
||||||
contentType: // The MIME content description
|
contentType: // The MIME content description
|
||||||
@ -240,7 +241,7 @@
|
|||||||
server: {value:"imap.gmail.com",required:true},
|
server: {value:"imap.gmail.com",required:true},
|
||||||
useSSL: {value: true},
|
useSSL: {value: true},
|
||||||
port: {value:"993",required:true},
|
port: {value:"993",required:true},
|
||||||
box: {value:"INBOX"}, // For IMAP, The mailbox to process
|
box: {value:"INBOX"}, // For IMAP, The mailbox to process
|
||||||
disposition: { value: "None" }, // For IMAP, the disposition of the read email
|
disposition: { value: "None" }, // For IMAP, the disposition of the read email
|
||||||
repeat: {value:"300",required:true}
|
repeat: {value:"300",required:true}
|
||||||
},
|
},
|
||||||
|
@ -89,6 +89,7 @@ module.exports = function(RED) {
|
|||||||
var sendopts = { from: node.userid }; // sender address
|
var sendopts = { from: node.userid }; // sender address
|
||||||
sendopts.to = node.name || msg.to; // comma separated list of addressees
|
sendopts.to = node.name || msg.to; // comma separated list of addressees
|
||||||
sendopts.subject = msg.topic || msg.title || "Message from Node-RED"; // subject line
|
sendopts.subject = msg.topic || msg.title || "Message from Node-RED"; // subject line
|
||||||
|
if (msg.hasOwnProperty("envelope")) { sendopts.envelope = msg.envelope; }
|
||||||
if (Buffer.isBuffer(msg.payload)) { // if it's a buffer in the payload then auto create an attachment instead
|
if (Buffer.isBuffer(msg.payload)) { // if it's a buffer in the payload then auto create an attachment instead
|
||||||
if (!msg.filename) {
|
if (!msg.filename) {
|
||||||
var fe = "bin";
|
var fe = "bin";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-email",
|
"name" : "node-red-node-email",
|
||||||
"version" : "0.1.5",
|
"version" : "0.1.6",
|
||||||
"description" : "Node-RED nodes to send and receive simple emails",
|
"description" : "Node-RED nodes to send and receive simple emails",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"nodemailer" : "1.11.*",
|
"nodemailer" : "1.11.*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user