Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alphasights/freya
Email links generator
https://github.com/alphasights/freya
Last synced: 5 days ago
JSON representation
Email links generator
- Host: GitHub
- URL: https://github.com/alphasights/freya
- Owner: alphasights
- License: mit
- Created: 2013-11-01T12:48:35.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-06T18:03:54.000Z (almost 11 years ago)
- Last Synced: 2024-04-14T07:25:15.629Z (7 months ago)
- Language: Ruby
- Homepage:
- Size: 266 KB
- Stars: 0
- Watchers: 60
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Freya
Tool to build mailto links using static email bodies pulled from a YAML config file.
## Installation
Add this line to your application's Gemfile:
gem 'freya'
And then execute:
$ bundle
Or install it yourself as:
$ gem install freya
## Usage
Create a yml file containing the bodies of your emails.
```yml
test:
email: This is a test email
```Then you create a link to this email like this:
```ruby
mail_to Freya::Email.new(name:'test.email', to: '[email protected]', subject: 'test_subject).link, 'Email'
```You can access mail bodies using the `name` attribute separating nodes with points.
You can also create your own email class and use `base_cc` and `base_bcc` to provide emails that have to be added to every cc and bcc of that subtype
For example:```ruby
class TeamMemberEmail < Freya::Email
def subject
'Team email'
enddef name
'team.email'
enddef base_cc
['[email protected]']
end
end
```If you want to create gmail links just use the `Freya::Gmail` class instead of the `Freya::Email` one.
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request