Ejemplo n.º 1
0
 def send_confirmed_tx_email(self):
     b58_address = self.address_subscription.b58_address
     context_dict = {
         'b58_address':
         b58_address,
         'coin_symbol':
         self.address_subscription.coin_symbol,
         'tx_hash':
         self.tx_hash,
         'num_confs':
         self.num_confs,
         'currency_display_name':
         self.address_subscription.get_currency_display_name(),
     }
     fkey_objs = {
         'transaction_event': self,
         'address_subscription': self.address_subscription,
     }
     return send_and_log(
         subject='Transaction %s... Confirmed' % self.tx_hash[:10],
         body_template='confirmed_tx.html',
         to_user=self.address_subscription.auth_user,
         body_context=context_dict,
         fkey_objs=fkey_objs,
     )
Ejemplo n.º 2
0
    def send_forwarding_welcome_email(self):
        # TODO: add abuse check so you can only send this email to an unconfirmed user X times

        if not self.auth_user:
            return

        context_dict = {
            'initial_address':
            self.initial_address,
            'destination_address':
            self.destination_address,
            'cs_display':
            constants.COIN_SYMBOL_MAPPINGS[self.coin_symbol]['display_name']
        }
        fkey_objs = {
            'address_forwarding': self,
        }
        return send_and_log(
            subject='Please Confirm Your Email Subscription to %s' %
            self.initial_address,
            body_template='new_user_forwarding.html',
            to_user=self.auth_user,
            body_context=context_dict,
            fkey_objs=fkey_objs,
        )
Ejemplo n.º 3
0
 def send_unconfirmed_tx_email(self):
     b58_address = self.address_subscription.b58_address
     sent_in_btc = format_crypto_units(
         input_quantity=self.satoshis_sent,
         input_type='satoshi',
         output_type='btc',
         coin_symbol=self.address_subscription.coin_symbol,
         print_cs=False,
         safe_trimming=False,
         round_digits=4,
     )
     fee_in_btc = format_crypto_units(
         input_quantity=self.fee_in_satoshis,
         input_type='satoshi',
         output_type='btc',
         coin_symbol=self.address_subscription.coin_symbol,
         print_cs=False,
         safe_trimming=False,
         round_digits=4,
     )
     context_dict = {
         'b58_address':
         b58_address,
         'coin_symbol':
         self.address_subscription.coin_symbol,
         'sent_in_btc':
         sent_in_btc,
         'fee_in_btc':
         fee_in_btc,
         'currency_display_name':
         self.address_subscription.get_currency_display_name(),
         'currency_abbrev':
         self.address_subscription.get_currency_abbrev(),
         'tx_hash':
         self.tx_hash,
         'num_confs':
         self.num_confs,
     }
     if self.address_subscription.address_forwarding_obj:
         context_dict[
             'destination_address'] = self.address_subscription.address_forwarding_obj.destination_address
         context_dict['satoshis_transacted'] = self.satoshis_sent
     fkey_objs = {
         'transaction_event': self,
         'address_subscription': self.address_subscription,
     }
     return send_and_log(
         subject='Unconfirmed Transaction for %s' % b58_address,
         body_template='new_tx.html',
         to_user=self.address_subscription.auth_user,
         body_context=context_dict,
         fkey_objs=fkey_objs,
     )
Ejemplo n.º 4
0
 def send_pwreset_email(self):
     """
     Send password reset email to user.
     """
     # TODO: add some sort of throttling
     return send_and_log(
         subject='Blockcypher Password Reset',
         body_template='password_reset.html',
         to_user=self,
         body_context={},
         fkey_objs={'auth_user': self},
     )
Ejemplo n.º 5
0
 def send_notifications_welcome_email(self):
     # TODO: add abuse check so you can only send this email to an  unconfirmed user X times
     b58_address = self.b58_address
     context_dict = {
         'b58_address':
         b58_address,
         'cs_display':
         constants.COIN_SYMBOL_MAPPINGS[self.coin_symbol]['display_name']
     }
     return send_and_log(
         subject='Please Confirm Your Email Subscription to %s' %
         b58_address,
         body_template='new_user_confirmation.html',
         to_user=self.auth_user,
         body_context=context_dict,
         fkey_objs={'address_subscription': self},
     )