Need gmail script to reply to selected message, change subject, and send. Then change label

So I’m a recent convert of Outlook+Exchange to Gmail (company forced). I approve a lot of requisitions and such in email for automated processing by other applications. To do this, I simply review the message and if I approve it, reply and add “Approved” to the end of the subject. In Outlook, I created the VBA macro that would take the selected message and do the this task automatically: reply; modify the subject; send; and move the original message. This made for 2 click process… 1 to select the message and review it, one to respond with approval and archive the original message.

I’m an old hand with VBA but completely green with google script. From what I’ve seen, it looks intuitive but I need some help getting started. I’d appreciate some pointers. I’ve included a snippet of the VBA code below:

Dim obj As Object
Dim msg As Outlook.MailItem
Dim msgReply As Outlook.MailItem

Set obj = GetCurrentItem 'grabs the currently selected item.
If TypeName(obj) = "MailItem" Then 'make sure the item is a mailitem
    Set msg = obj 'msg is now the mail item to work on
    If msg.Parent = "AP Invoices" Then 'need to make sure the msg is in the AP Invoices folder 
        Set msgReply = msg.ReplyAll 'this initiates a reply all to the msg
        msgReply.Subject = msgReply.Subject & "Approved" 'adds "Approved" to end existing subject
        msgReply.Display 'displays the message
        msgReply.Send 'sends the message
        msg.UnRead = False 'marks the original msg as read
        msg.Move olProcessedFolder 'moves the original msg to a different folder
    end if
end if
 

In Outlook, I used rules to get the email into the “AP Invoices” folder and I have gmail doing the same for a label using a filter.

Question: Once I have a script, how do I manually initiate it? On Outlook, I added a command button on the toolbar that launched the VBA macro… not sure if that is possible in Gmail.

Appreciate any assistance.

Google Forms can send an interactive multi-question form by email. What tech allows for form rendering in an email body?

Google Forms can embed a multi-question survey into an email body, with a submit button to send responses. Actually when the user clicks submit it opens to form on a web page and populates the fields from the email entries.

Email clients filter out Javascript code and restrict certain CSS and HTML rendering features. The details are complex.

My question is how is can the Google Form sent by email as html? No other survey webapp has this feature. I have checked Survey Monkey, TypeForm, etc. They can render survey questions in an email disguised as regular links that open a web page. Google forms has fillable text fields, radio buttons, and checkboxes.

What methods, languages and tools can be used to make dynamic interactive surveys delivered as an email?

Google form embedded in an email

Can a computer fan send you a code?

Normally, when I turn on my cpu the fan goes to high speed for a second and normalizes. Lately, when I start my CPU the fan seems to send me a code in pulses. Similar to how some devises send an error code through a flashing light, but in this case a flashing fan; can a cpu fan send a code and are used like this? If not intentional, what would cause the fan’s sofeware to be changed or signal to the fan interrupted?

The fan sounds normal and silent as always and cpu is normal too.

How do I programmatically send a mail after changing a workflow state?

How do I programmatically send a mail after changing a workflow state?

When a node is created, I send a mail. I want to send a mail on Workflow state operations.

function mails_node_insert(EntityInterface $entity) {
  if ($entity->getEntityTypeId() !== 'node' || ($entity->getEntityTypeId() === 'node' && $entity->bundle() !== 'article')) {
    return;
  }

  $node = Drupal::entityManager()->getStorage('node')->load($entity->id());

  if ($node->get("field_workflow")->value == "test_published") {
    $result = $node->get("body")->getString();
    if ($result != true) {
      drupal_set_message(t('Sorry , due to some error mail , we cant send a mail.'), 'error');
    }
    else {
      drupal_set_message(t('The mail has been sent successfully.'));
    }
  }
}

How to send BTC amount from one specific address in Bitcoin Core

I canceled one transaction that was in the memory pool, now I would like to make sure that this transaction will not be sent anymore sending all BTC amount of the original address of this transaction to another address, but when I go to send BTC in Bitcoin Core, I can’t choose one specific address to send the amount. So what Can I do to “empty” the bitcoins of this address using Bitcoin Core?

How to send traceroute to provider for troubleshooting


I know how to use win MTR and I sent the information to my provider

but they say then need the same information from the server to my computer

So in centos 7 cpanel I need to go and traceroute to my home computer ?

It seems my home ISp has connectivity with my site and all others with same ISP

other are ok and all I need is to send tme MTR traceroute from both side

magento2 – How to Send a Copy of Order Confirmation Emails to Dynamic EmailId in Magento 2

I have a made custom module of the sales rep. They can create an order for a customer. When sales rep place order at that time order confirmation email copy sent to assign sales reps in order.

I have store sales rep email id in Quote & order both tables. If any query please let me know. Please any can help me

Note: The code is working on the local server. But In an enterprise, it’s not working.

  1. create an event for a set variable. create event.xml

     <event name="email_order_set_template_vars_before">
         <observer name="set_email_po_order" instance="VendorModulenameObserverEmailOrderSetTemplateVarsBefore" />
     </event>
    
  2. set variable dynamic from the get order table

     <?php
     namespace VendorModulenameObserver;
    
     use MagentoFrameworkEventObserver;
     use MagentoFrameworkEventObserverInterface;
    
     class EmailOrderSetTemplateVarsBefore implements ObserverInterface {
    
     private $orderEmail;
     protected $scopeConfig;
    
     public function __construct(
         VendorModulenameModelOrderEmail $orderEmail,
         VendorModulenameModelSalesrepFactory $salesrepData,
         MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
     ){
         $this->orderEmail = $orderEmail;
         $this->_salesrepData = $salesrepData;
         $this->scopeConfig = $scopeConfig;
     }
    
     public function execute(Observer $observer)
     {
         $transportObject = $observer->getData('transportObject');
         if($transportObject->getData('order')){
             try {
                 if($order->getSalesrepId()){
                     $getSalesrepData = $this->_salesrepData->create()->load($order->getSalesrepId());          
                     if($getSalesrepData->getEmail()){
                         $notiEmails = $getSalesrepData->getEmail();
                         $this->orderEmail->setSalesrepEmails($notiEmails);
                         $logger->debug("Order email copy send to salesrep sucessfully....");
                     }
                 }
    
             } catch (Exception $e) {
                 $logger->error('Error while send design customer Email', ('exception' => $e));
                 echo $e->getMessage(); 
             } 
         }
     }
    

    }
    ?>

  3. create a model for set private

     <?php
     namespace VendorModulenameModel;
     class OrderEmail {
     private $extraOrderEmailId;
    
     public function setSalesrepEmails($email){
         $this->extraOrderEmailId = $email;
     }
     public function getSalesrepEmails()
     {
         return $this->extraOrderEmailId;
     }
    

    }

  4. Add plugin di.xml

     <type name="MagentoSalesModelOrderEmailContainerOrderIdentity">
             <plugin name="add_email_to_order_copy" type="VendorModulenamePluginOrderEmailContainerOrderIdentity" sortOrder="1" disabled="false" />
     </type>
    
  5. Create a plugin file

     <?php   
      namespace VendorModulenamePluginOrderEmailContainer;    
      class OrderIdentity{
          public function __construct(
             VendorModulenameModelOrderEmail $orderEmail
          ){
              $this->orderEmail = $orderEmail;
          }
           public function afterGetEmailCopyTo(
           MagentoSalesModelOrderEmailContainerOrderIdentity $subject,
           $result
           ){
     $additionalEmailId =  $this->orderEmail->getSalesrepEmails();
     if(($additionalEmailId === null) || (!$additionalEmailId) || empty($additionalEmailId)){
         return $result;
     }
     else{
         $additionalEmailId =  explode(",",$this->orderEmail->getSalesrepEmails());
         if(count($additionalEmailId)==0 || empty($additionalEmailId)){
             return $result;
         }
         else{
             if (!empty($result) && is_array($result)){
                 foreach($additionalEmailId as $additionalEmail):
                     $result() = (string) $additionalEmail;
                 endforeach;
                 return $result;
             }else{
                 return $additionalEmailId;
             }
         }
     }
     }
      }
    

powerapp – How to send JSON data to Power Apps from Power Automate (MS Flow)

I am getting the list Item attachments using the Get Attachments action in the flow.

As the output, I have the JSON object which contains the information of attachments.

Now, I want to send this JSON to the Power Apps.

Respond to Power Apps action allows us to send only single items, not objects.

How can I achieve the above?

Note: Please suggest a way which does not contain the use of a premium connector.

postfix – iRedmail cannot send Email to outside networks “Connection timed out”

After a successful installation of the mail server with iRedmail installer, I cannot send Emails to the outside networks.

I can successfully receive mails, but I cannot create a new mail (to the outside networks) or reply from a received one.

Whenever I send an Email, this is what comes out on my mails log;

Jul  2 13:34:42 hostname postfix/smtp(113264): connect to gmail-smtp-in.l.google.com(2a00:1450:4010:c03::1a):25: Connection timed out
Jul  2 13:35:12 hostname postfix/smtp(113264): connect to alt1.gmail-smtp-in.l.google.com(2404:6800:4003:c06::1a):25: Connection timed out

and

         1   Jul  1 13:29:46 hostname postfix/smtp(54364): 49x3wF0hvGz2wtK: to=<myemail@live.com>, relay=none, delay=78302, delays=78241/0.04/60/0, dsn=4.4.1, status=deferred (connect to live-com.olc.protection.outlook.com(104.47.58.161):25: Connection timed out)

I have

iRedMail version: 1.3
Ubuntu: 20.04 LTS

I checked the server “mbuyufikra.org” is not blacklisted (yet)

Also the postfix main.cf file;

# --------------------
# INSTALL-TIME CONFIGURATION INFORMATION
#
# location of the Postfix queue. Default is /var/spool/postfix.
queue_directory = /var/spool/postfix

# location of all postXXX commands. Default is /usr/sbin.
command_directory = /usr/sbin

# location of all Postfix daemon programs (i.e. programs listed in the
# master.cf file). This directory must be owned by root.
# Default is /usr/libexec/postfix
daemon_directory = /usr/lib/postfix/sbin

# location of Postfix-writable data files (caches, random numbers).
# This directory must be owned by the mail_owner account (see below).
# Default is /var/lib/postfix.
data_directory = /var/lib/postfix

# owner of the Postfix queue and of most Postfix daemon processes.
# Specify the name of a user account THAT DOES NOT SHARE ITS USER OR GROUP ID
# WITH OTHER ACCOUNTS AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM.
# In particular, don't specify nobody or daemon. PLEASE USE A DEDICATED USER.
# Default is postfix.
mail_owner = postfix

# The following parameters are used when installing a new Postfix version.
#
# sendmail_path: The full pathname of the Postfix sendmail command.
# This is the Sendmail-compatible mail posting interface.
#
sendmail_path = /usr/sbin/sendmail

# newaliases_path: The full pathname of the Postfix newaliases command.
# This is the Sendmail-compatible command to build alias databases.
#
newaliases_path = /usr/bin/newaliases

# full pathname of the Postfix mailq command.  This is the Sendmail-compatible
# mail queue listing command.
mailq_path = /usr/bin/mailq

# group for mail submission and queue management commands.
# This must be a group name with a numerical group ID that is not shared with
# other accounts, not even with the Postfix account.
setgid_group = postdrop

# external command that is executed when a Postfix daemon program is run with
# the -D option.
#
# Use "command .. & sleep 5" so that the debugger can attach before
# the process marches on. If you use an X-based debugger, be sure to
# set up your XAUTHORITY environment variable before starting Postfix.
#
debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    ddd $daemon_directory/$process_name $process_id & sleep 5

debug_peer_level = 2

# --------------------
# CUSTOM SETTINGS
#

# SMTP server response code when recipient or domain not found.
unknown_local_recipient_reject_code = 550

# Do not notify local user.
biff = no

# Disable the rewriting of "site!user" into "user@site".
swap_bangpath = no

# Disable the rewriting of the form "user%domain" to "user@domain".
allow_percent_hack = no

# Allow recipient address start with '-'.
allow_min_user = no

# Disable the SMTP VRFY command. This stops some techniques used to
# harvest email addresses.
disable_vrfy_command = yes

# Enable both IPv4 and/or IPv6: ipv4, ipv6, all.
inet_protocols = all

# Enable all network interfaces.
inet_interfaces = all

#
# TLS settings.
#
# SSL key, certificate, CA
#
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail.crt
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail.crt
smtpd_tls_CApath = /etc/ssl/certs

#
# Disable SSLv2, SSLv3
#
smtpd_tls_protocols = !SSLv2 !SSLv3
smtpd_tls_mandatory_protocols = !SSLv2 !SSLv3
smtp_tls_protocols = !SSLv2 !SSLv3
smtp_tls_mandatory_protocols = !SSLv2 !SSLv3
lmtp_tls_protocols = !SSLv2 !SSLv3
lmtp_tls_mandatory_protocols = !SSLv2 !SSLv3

#
# Fix 'The Logjam Attack'.
#
smtpd_tls_exclude_ciphers = aNULL, eNULL, EXPORT, DES, RC4, MD5, PSK, aECDH, EDH-DSS-DES-CBC3-SHA, EDH-RSA-DES-CDC3-SHA, KRB5-DE5, CBC3-SHA
smtpd_tls_dh512_param_file = /etc/ssl/dh512_param.pem
smtpd_tls_dh1024_param_file = /etc/ssl/dh2048_param.pem

tls_random_source = dev:/dev/urandom

# Log only a summary message on TLS handshake completion — no logging of client
# certificate trust-chain verification errors if client certificate
# verification is not required. With Postfix 2.8 and earlier, log the summary
# message, peer certificate summary information and unconditionally log
# trust-chain verification errors.
smtp_tls_loglevel = 1
smtpd_tls_loglevel = 1

# Opportunistic TLS: announce STARTTLS support to remote SMTP clients, but do
# not require that clients use TLS encryption.
smtpd_tls_security_level = may

# Produce `Received:` message headers that include information about the
# protocol and cipher used, as well as the remote SMTP client CommonName and
# client certificate issuer CommonName.
# This is disabled by default, as the information may be modified in transit
# through other mail servers. Only information that was recorded by the final
# destination can be trusted.
#smtpd_tls_received_header = yes

# Opportunistic TLS, used when Postfix sends email to remote SMTP server.
# Use TLS if this is supported by the remote SMTP server, otherwise use
# plaintext.
# References:
#   - http://www.postfix.org/TLS_README.html#client_tls_may
#   - http://www.postfix.org/postconf.5.html#smtp_tls_security_level
smtp_tls_security_level = may

# Use the same CA file as smtpd.
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_CAfile = $smtpd_tls_CAfile
smtp_tls_note_starttls_offer = yes

# Enable long, non-repeating, queue IDs (queue file names).
# The benefit of non-repeating names is simpler logfile analysis and easier
# queue migration (there is no need to run "postsuper" to change queue file
# names that don't match their message file inode number).
enable_long_queue_ids = yes

# Reject unlisted sender and recipient
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes

# Header and body checks with PCRE table
header_checks = pcre:/etc/postfix/header_checks
body_checks = pcre:/etc/postfix/body_checks.pcre

# A mechanism to transform commands from remote SMTP clients.
# This is a last-resort tool to work around client commands that break
# interoperability with the Postfix SMTP server. Other uses involve fault
# injection to test Postfix's handling of invalid commands.
# Requires Postfix-2.7+.
smtpd_command_filter = pcre:/etc/postfix/command_filter.pcre

# HELO restriction
smtpd_helo_required = yes
smtpd_helo_restrictions =
    permit_mynetworks
    permit_sasl_authenticated
    check_helo_access pcre:/etc/postfix/helo_access.pcre
    reject_non_fqdn_helo_hostname
    reject_unknown_helo_hostname

# Sender restrictions
smtpd_sender_restrictions =
    reject_non_fqdn_sender
    reject_unlisted_sender
    permit_mynetworks
    permit_sasl_authenticated
    check_sender_access pcre:/etc/postfix/sender_access.pcre
    reject_unknown_sender_domain

# Recipient restrictions
smtpd_recipient_restrictions =
    reject_non_fqdn_recipient
    reject_unlisted_recipient
    check_policy_service inet:127.0.0.1:7777
    permit_mynetworks
    permit_sasl_authenticated
    reject_unauth_destination
    check_policy_service inet:127.0.0.1:12340

# END-OF-MESSAGE restrictions
smtpd_end_of_data_restrictions =
    check_policy_service inet:127.0.0.1:7777

# Data restrictions
smtpd_data_restrictions = reject_unauth_pipelining

# SRS (Sender Rewriting Scheme) support
#sender_canonical_maps = tcp:127.0.0.1:7778
#sender_canonical_classes = envelope_sender
#recipient_canonical_maps = tcp:127.0.0.1:7779
#recipient_canonical_classes= envelope_recipient,header_recipient

proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions $sender_dependent_relayhost_maps

# Avoid duplicate recipient messages. Default is 'yes'.
enable_original_recipient = no

# Virtual support.
virtual_minimum_uid = 2000
virtual_uid_maps = static:2000
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail

# Do not set virtual_alias_domains.
virtual_alias_domains =

#
# Enable SASL authentication on port 25 and force TLS-encrypted SASL authentication.
# WARNING: NOT RECOMMENDED to enable smtp auth on port 25, all end users should
#          be forced to submit email through port 587 instead.
#
#smtpd_sasl_auth_enable = yes
#smtpd_sasl_security_options = noanonymous
#smtpd_tls_auth_only = yes

# hostname
myhostname = hostname.domain.org
myorigin = hostname.domain.org
mydomain = hostname.domain.org

# trusted SMTP clients which are allowed to relay mail through Postfix.
#
# Note: additional IP addresses/networks listed in mynetworks should be listed
#       in iRedAPD setting 'MYNETWORKS' (in `/opt/iredapd/settings.py`) too.
#       for example:
#
#       MYNETWORKS = ('xx.xx.xx.xx', 'xx.xx.xx.0/24', ...)
#
mynetworks = 127.0.0.1 (::1)

# Accepted local emails
mydestination = $myhostname, localhost, localhost.localdomain

alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases

# Default message_size_limit.
message_size_limit = 15728640

# The set of characters that can separate a user name from its extension
# (example: user+foo), or a .forward file name from its extension (example:
# .forward+foo).
# Postfix 2.11 and later supports multiple characters.
recipient_delimiter = +

# The time after which the sender receives a copy of the message headers of
# mail that is still queued. Default setting is disabled (0h) by Postfix.
#delay_warning_time = 1h

# Do not display the name of the recipient table in the "User unknown" responses.
# The extra detail makes trouble shooting easier but also reveals information
# that is nobody elses business.
show_user_unknown_table_name = no
compatibility_level = 2
#
# Lookup virtual mail accounts
#
transport_maps =
    proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf
    proxy:mysql:/etc/postfix/mysql/transport_maps_maillist.cf
    proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf

sender_dependent_relayhost_maps =
    proxy:mysql:/etc/postfix/mysql/sender_dependent_relayhost_maps.cf

# Lookup table with the SASL login names that own the sender (MAIL FROM) addresses.
smtpd_sender_login_maps =
    proxy:mysql:/etc/postfix/mysql/sender_login_maps.cf

virtual_mailbox_domains =
    proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf

relay_domains =
    $mydestination
    proxy:mysql:/etc/postfix/mysql/relay_domains.cf

virtual_mailbox_maps =
    proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf

virtual_alias_maps =
    proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf
    proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf
    proxy:mysql:/etc/postfix/mysql/catchall_maps.cf
    proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf

sender_bcc_maps =
    proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf
    proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf

recipient_bcc_maps =
    proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf
    proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf

#
# Postscreen
#
postscreen_greet_action = drop
postscreen_blacklist_action = drop
postscreen_dnsbl_action = drop
postscreen_dnsbl_threshold = 2

# Attention:
#   - zen.spamhaus.org free tire has 3 limits
#     (https://www.spamhaus.org/organization/dnsblusage/):
#
#     1) Your use of the Spamhaus DNSBLs is non-commercial*, and
#     2) Your email traffic is less than 100,000 SMTP connections per day, and
#     3) Your DNSBL query volume is less than 300,000 queries per day.
#
#   - FAQ: "Your DNSBL blocks nothing at all!"
#     https://www.spamhaus.org/faq/section/DNSBL%20Usage#261
#
# It's strongly recommended to use a local DNS server for cache.
postscreen_dnsbl_sites =
    zen.spamhaus.org=127.0.0.(2..11)*3
    b.barracudacentral.org=127.0.0.2*2

postscreen_dnsbl_reply_map = texthash:/etc/postfix/postscreen_dnsbl_reply
postscreen_access_list = permit_mynetworks cidr:/etc/postfix/postscreen_access.cidr

# Require Postfix-2.11+
postscreen_dnsbl_whitelist_threshold = -2

#
# Dovecot SASL support.
#
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/dovecot-auth
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

#
# mlmmj - mailing list manager
#
mlmmj_destination_recipient_limit = 1

#
# Amavisd + SpamAssassin + ClamAV
#
content_filter = smtp-amavis:(127.0.0.1):10024

# Concurrency per recipient limit.
smtp-amavis_destination_recipient_limit = 1

I have not touched this file a bit, it is just they way iRedmail configured it.