Giter Club home page Giter Club logo

concrete5mailer's Introduction

Concrete5 Mailer Package

Adds cool mailing functionality to Concrete5.

What is this

This a package made to made the developer's life a little bit easier and the customer a little bit happier.

What is this NOT

This a not an idiot-proof tool. Although it makes certain things easy, you can screw up one or two things if you are not careful. Nothing too dangerous.

Version

1.0

Requirements

  • Concrete5 5.6.1.2 to Concrete5 5.7

Installation

Download in Packages folder and install from dashboard.

Usage

Load the Mailer helper

//Load the Mailer helper
$mailer = Loader::helper('mailer','c5mailer');

Specify which template to use

//Specify the Page name to be used as template
$mailer->setMailTemplate( 'Demo Basic Template' );

//Or: Use the collection ID, if known
$mailer->setPageID( 139 );

//Or: Use the collection
$mailer->setPage( $page );

Optional: Set the sender. Fallback: the global defined one will be used

$mailer->setSender( '[email protected]', 'Auto Robots' );
$mailer->setSender( '[email protected]' ); //name is optional

Optional: Set reply to

$mailer->setReplyTo( '[email protected]', 'Real Human' );
$mailer->setReplyTo( '[email protected]' ); //name is optional

Required: Set the receiver

$mailer->setReceiver( '[email protected]', 'John Doe' );
$mailer->setReceiver( '[email protected]' ); //name is optional

Optional: set the subject. Fallback: the page description will be used

$mailer->setSubject( 'Catchy Email Subject' );

//email var can be used in subject as well
$mailer->setSubject( 'Catchy Email Subject For %username%' );

Optional: add the replacements array

$mailer->setReplacements(array(
        'username' => 'John Doe',
        'another_var' => 'Lorem Ipsum',
));

Optional: add attachments

//By File Path
$mailer->attachFileByPath( '/tmp/Comp_2.jpg' );
$mailer->attachFileByPath( '/tmp/Comp_2.jpg', 'nice_name.jpg' ); //name is optional

//And/Or Using a Concrete5 File
$mailer->attachFile( File::getByID(3) );

//And/Or Using a Concrete5 FileID
$mailer->attachFileByID( 4 );

Send the email

$mailer->send();

License

(C) Copyright Stefan Fodor([email protected]) @ 2014

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Lastly

Software built with love in Denmark.

concrete5mailer's People

Contributors

xtephan avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

concrete5mailer's Issues

System page

Concrete5 overrites emai templates as system pages.

Problem lies in Concrete5_Model_Page::rescanSystemPageStatus()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.