772 lines
No EOL
20 KiB
HTML
772 lines
No EOL
20 KiB
HTML
<!-- title: Communication -->
|
|
|
|
|
|
|
|
|
|
|
|
<div class="dev-header">
|
|
|
|
<a class="btn btn-default btn-sm" disabled style="margin-bottom: 10px;">
|
|
Version 6.x.x</a>
|
|
|
|
|
|
<a class="btn btn-default btn-sm" href="https://github.com/frappe/frappe/tree/develop/frappe/core/doctype/communication"
|
|
target="_blank" style="margin-left: 10px; margin-bottom: 10px;"><i class="octicon octicon-mark-github"></i> Source</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<p><b>Table Name:</b> <code>tabCommunication</code></p>
|
|
|
|
|
|
Keep a track of all communications
|
|
|
|
<h3>Fields</h3>
|
|
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 5%">Sr</th>
|
|
<th style="width: 25%">Fieldname</th>
|
|
<th style="width: 20%">Type</th>
|
|
<th style="width: 25%">Label</th>
|
|
<th style="width: 25%">Options</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr >
|
|
<td>1</td>
|
|
<td ><code>naming_series</code></td>
|
|
<td >
|
|
Select</td>
|
|
<td class="text-muted" title="Hidden">
|
|
Series
|
|
|
|
</td>
|
|
<td>
|
|
<pre>COMM-</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>2</td>
|
|
<td ><code>communication_medium</code></td>
|
|
<td >
|
|
Select</td>
|
|
<td >
|
|
Communication Medium
|
|
|
|
</td>
|
|
<td>
|
|
<pre>
|
|
Chat
|
|
Phone
|
|
Email
|
|
SMS
|
|
Visit
|
|
Other</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>3</td>
|
|
<td ><code>recipients</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Recipients
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>4</td>
|
|
<td ><code>cc</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
CC
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>5</td>
|
|
<td ><code>phone_no</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Phone No.
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>6</td>
|
|
<td ><code>column_break_5</code></td>
|
|
<td class="info">
|
|
Column Break</td>
|
|
<td >
|
|
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>7</td>
|
|
<td ><code>status</code></td>
|
|
<td >
|
|
Select</td>
|
|
<td >
|
|
Status
|
|
|
|
</td>
|
|
<td>
|
|
<pre>Open
|
|
Replied
|
|
Closed
|
|
Linked</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>8</td>
|
|
<td class="danger" title="Mandatory"><code>sent_or_received</code></td>
|
|
<td >
|
|
Select</td>
|
|
<td >
|
|
Sent or Received
|
|
|
|
</td>
|
|
<td>
|
|
<pre>Sent
|
|
Received</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>9</td>
|
|
<td ><code>delivery_status</code></td>
|
|
<td >
|
|
Select</td>
|
|
<td class="text-muted" title="Hidden">
|
|
Delivery Status
|
|
<p class="text-muted small">
|
|
Integrations can use this field to set email delivery status</p>
|
|
</td>
|
|
<td>
|
|
<pre>
|
|
Sent
|
|
Bounced
|
|
Opened
|
|
Marked As Spam
|
|
Rejected
|
|
Delayed
|
|
Soft-Bounced
|
|
Clicked
|
|
Recipient Unsubscribed</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="info">
|
|
<td>10</td>
|
|
<td ><code>section_break_10</code></td>
|
|
<td >
|
|
Section Break</td>
|
|
<td >
|
|
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>11</td>
|
|
<td class="danger" title="Mandatory"><code>subject</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Subject
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr class="info">
|
|
<td>12</td>
|
|
<td ><code>section_break_8</code></td>
|
|
<td >
|
|
Section Break</td>
|
|
<td >
|
|
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>13</td>
|
|
<td ><code>content</code></td>
|
|
<td >
|
|
Text Editor</td>
|
|
<td >
|
|
Content
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr class="info">
|
|
<td>14</td>
|
|
<td ><code>additional_info</code></td>
|
|
<td >
|
|
Section Break</td>
|
|
<td >
|
|
More Information
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>15</td>
|
|
<td ><code>sender</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Sender
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>16</td>
|
|
<td ><code>sender_full_name</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Sender Full Name
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>17</td>
|
|
<td ><code>communication_date</code></td>
|
|
<td >
|
|
Datetime</td>
|
|
<td >
|
|
Date
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>18</td>
|
|
<td ><code>column_break_14</code></td>
|
|
<td class="info">
|
|
Column Break</td>
|
|
<td >
|
|
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>19</td>
|
|
<td ><code>reference_doctype</code></td>
|
|
<td >
|
|
Link</td>
|
|
<td >
|
|
Reference DocType
|
|
|
|
</td>
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/core/doctype">DocType</a>
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>20</td>
|
|
<td ><code>reference_name</code></td>
|
|
<td >
|
|
Dynamic Link</td>
|
|
<td >
|
|
Reference Name
|
|
|
|
</td>
|
|
<td>
|
|
<pre>reference_doctype</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>21</td>
|
|
<td ><code>in_reply_to</code></td>
|
|
<td >
|
|
Link</td>
|
|
<td >
|
|
In Reply To
|
|
|
|
</td>
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/core/communication">Communication</a>
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>22</td>
|
|
<td ><code>email_account</code></td>
|
|
<td >
|
|
Link</td>
|
|
<td >
|
|
Email Account
|
|
|
|
</td>
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/email/email_account">Email Account</a>
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>23</td>
|
|
<td ><code>user</code></td>
|
|
<td >
|
|
Link</td>
|
|
<td >
|
|
User
|
|
|
|
</td>
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/core/user">User</a>
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>24</td>
|
|
<td ><code>unread_notification_sent</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Unread Notification Sent
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>25</td>
|
|
<td ><code>_user_tags</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td class="text-muted" title="Hidden">
|
|
User Tags
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<hr>
|
|
<h3>Controller</h3>
|
|
<h4>frappe.core.doctype.communication.communication</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 style="font-weight: normal;">Class <b>Communication</b></h3>
|
|
|
|
<p style="padding-left: 30px;"><i>Inherits from frappe.model.document.Document</i></h4>
|
|
|
|
<div class="docs-attr-desc"><p></p>
|
|
</div>
|
|
<div style="padding-left: 30px;">
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="_notify" href="#_notify" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>_notify</b>
|
|
<i class="text-muted">(self, print_html=None, print_format=None, attachments=None, recipients=None, cc=None)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="after_insert" href="#after_insert" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>after_insert</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="filter_email_list" href="#filter_email_list" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>filter_email_list</b>
|
|
<i class="text-muted">(self, email_list, exclude, is_cc=False)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="get_assignees" href="#get_assignees" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>get_assignees</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="get_attach_link" href="#get_attach_link" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>get_attach_link</b>
|
|
<i class="text-muted">(self, print_format)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Returns public link for the attachment via <code>templates/emails/print_link.html</code>.</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="get_cc" href="#get_cc" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>get_cc</b>
|
|
<i class="text-muted">(self, recipients=None, fetched_from_email_account=False)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Build a list of email addresses for CC</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="get_owner_email" href="#get_owner_email" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>get_owner_email</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="get_parent_doc" href="#get_parent_doc" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>get_parent_doc</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Returns document of <code>reference_doctype</code>, <code>reference_doctype</code></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="get_recipients" href="#get_recipients" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>get_recipients</b>
|
|
<i class="text-muted">(self, fetched_from_email_account=False)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Build a list of email addresses for To</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="get_recipients_and_cc" href="#get_recipients_and_cc" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>get_recipients_and_cc</b>
|
|
<i class="text-muted">(self, recipients, cc, fetched_from_email_account=False)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="notify" href="#notify" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>notify</b>
|
|
<i class="text-muted">(self, print_html=None, print_format=None, attachments=None, recipients=None, cc=None, fetched_from_email_account=False)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Calls a delayed celery task 'sendmail' that enqueus email in Bulk Email queue</p>
|
|
|
|
<p><strong>Parameters:</strong></p>
|
|
|
|
<ul>
|
|
<li><strong><code>print_html</code></strong> - Send given value as HTML attachment</li>
|
|
<li><strong><code>print_format</code></strong> - Attach print format of parent document</li>
|
|
<li><strong><code>attachments</code></strong> - A list of filenames that should be attached when sending this email</li>
|
|
<li><strong><code>recipients</code></strong> - Email recipients</li>
|
|
<li><strong><code>cc</code></strong> - Send email as CC to</li>
|
|
<li><strong><code>fetched_from_email_account</code></strong> - True when pulling email, the notification shouldn't go to the main recipient</li>
|
|
</ul>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="on_update" href="#on_update" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>on_update</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Update parent status as <code>Open</code> or <code>Replied</code>.</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="prepare_to_notify" href="#prepare_to_notify" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>prepare_to_notify</b>
|
|
<i class="text-muted">(self, print_html=None, print_format=None, attachments=None)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Prepare to make multipart MIME Email</p>
|
|
|
|
<p><strong>Parameters:</strong></p>
|
|
|
|
<ul>
|
|
<li><strong><code>print_html</code></strong> - Send given value as HTML attachment.</li>
|
|
<li><strong><code>print_format</code></strong> - Attach print format of parent document.</li>
|
|
</ul>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="send" href="#send" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>send</b>
|
|
<i class="text-muted">(self, print_html=None, print_format=None, attachments=None, send_me_a_copy=False, recipients=None)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Send communication via Email.</p>
|
|
|
|
<p><strong>Parameters:</strong></p>
|
|
|
|
<ul>
|
|
<li><strong><code>print_html</code></strong> - Send given value as HTML attachment.</li>
|
|
<li><strong><code>print_format</code></strong> - Attach print format of parent document.</li>
|
|
</ul>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="set_incoming_outgoing_accounts" href="#set_incoming_outgoing_accounts" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>set_incoming_outgoing_accounts</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="update_parent" href="#update_parent" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>update_parent</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Update status of parent document based on who is replying.</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="validate" href="#validate" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>validate</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p><span class="label label-info">Public API</span>
|
|
<br><code>/api/method/frappe.core.doctype.communication.communication.make</code>
|
|
</p>
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.core.doctype.communication.communication.make" href="#frappe.core.doctype.communication.communication.make" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.core.doctype.communication.communication.<b>make</b>
|
|
<i class="text-muted">(doctype=None, name=None, content=None, subject=None, sent_or_received=Sent, sender=None, recipients=None, communication_medium=Email, send_email=False, print_html=None, print_format=None, attachments=[], ignore_doctype_permissions=False, send_me_a_copy=False, cc=None)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Make a new communication.</p>
|
|
|
|
<p><strong>Parameters:</strong></p>
|
|
|
|
<ul>
|
|
<li><strong><code>doctype</code></strong> - Reference DocType.</li>
|
|
<li><strong><code>name</code></strong> - Reference Document name.</li>
|
|
<li><strong><code>content</code></strong> - Communication body.</li>
|
|
<li><strong><code>subject</code></strong> - Communication subject.</li>
|
|
<li><strong><code>sent_or_received</code></strong> - Sent or Received (default <strong>Sent</strong>).</li>
|
|
<li><strong><code>sender</code></strong> - Communcation sender (default current user).</li>
|
|
<li><strong><code>recipients</code></strong> - Communication recipients as list.</li>
|
|
<li><strong><code>communication_medium</code></strong> - Medium of communication (default <strong>Email</strong>).</li>
|
|
<li><strong><code>send_mail</code></strong> - Send via email (default <strong>False</strong>).</li>
|
|
<li><strong><code>print_html</code></strong> - HTML Print format to be sent as attachment.</li>
|
|
<li><strong><code>print_format</code></strong> - Print Format name of parent document to be sent as attachment.</li>
|
|
<li><strong><code>attachments</code></strong> - List of attachments as list of files or JSON string.</li>
|
|
<li><strong><code>send_me_a_copy</code></strong> - Send a copy to the sender (default <strong>False</strong>).</li>
|
|
</ul>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.core.doctype.communication.communication.on_doctype_update" href="#frappe.core.doctype.communication.communication.on_doctype_update" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.core.doctype.communication.communication.<b>on_doctype_update</b>
|
|
<i class="text-muted">()</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Add index in <code>tabCommunication</code> for <code>(reference_doctype, reference_name)</code></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4>Linked In:</h4>
|
|
<ul>
|
|
|
|
|
|
<li>
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/core/communication">Communication</a>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<!-- autodoc -->
|
|
<!-- jinja -->
|
|
<!-- static --> |