Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- authToken = req.headers.authorization;
- userAuthObj = JSON.parse(UserAuthServices.userAuthTokenValidator(authToken));
- var todayDate = new Date();
- var expireDate = new Date(userAuthObj.expire_date);
- tokenOK = TokenValidator.validateToken(userAuthObj.user_id, authToken).then(function (userSessions) {
- if (userSessions.length === 1) {
- if (expireDate >= todayDate) {
- template_id = req.params.id;
- image_id = req.params.img_id;
- TemplateController.findById(template_id, {
- attributes: {
- exclude: ['created_by', 'created_on', 'updated_by', 'updated_on']
- },
- include: [{
- attributes: {
- exclude: ['created_by', 'created_on', 'updated_by', 'updated_on']
- },
- model: Broadcasting,
- where: {
- id: image_id,
- }
- },
- ]
- }
- ).then(function (templatefindByid) {
- BccSetting.findAll({
- where: {
- template_id: template_id
- }
- }).then(bccSettings => {
- res.status(200).json({
- id: templatefindByid.id,
- name: templatefindByid.name,
- template_images: templatefindByid.template_images,
- bcc_settings: bccSettings,
- })
- }).catch(err => {
- console.log(err);
- res.status(404).json({
- message: ' not found...'
- });
- });
- }).catch(function (err) {
- console.log(err);
- res.status(404).json({
- message: 'not found...'
- });
- });
- } else {
- res.status(401).json({
- message: 'Not ...'
- });
- }
- } else {
- res.status(401).json({
- message: 'Expired...'
- });
- }
- }).catch(function (err) {
- res.status(401).json({
- message: 'Expired...'
- });
- });
- host: 'smtp.gmail.com',
- port: 465,
- auth: true,
- active: true,
- secure: true,
- requireTLS: true,
- auth: {
- user: 'trans@gmail.com',
- pass: 'wertyy'
- }
- from: 'trans@gmail.com',
- to: 'wwww@gmail.com',
- bcc: bcc_setting.bcc_setting,// here i want bcc setting data
- subject: 'yvnuyybymyed',
- html: 'result'
- if (error) {
- return console.log("mail not sent" + error.message);
- }
- console.log('success');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement