November 2018 Summaries
5 posts from Contentful
Filter
Month:
Year:
Post Summaries
Back to Blog
Contentful provides a modern approach to generating email notifications that keeps code and design separate, using webhooks functionality and cloud functions to create, schedule, and send campaigns based on publish events in Contentful. The solution uses MailChimp's templates with editable sections, Mustache templating language, and JSON-friendly templating to simplify the process of sending campaigns. To trigger the creation of a campaign in MailChimp, Contentful's webhook is used to send data that is then processed by a cloud function, which generates HTML content using Mustache's render function and sends it to MailChimp for campaign creation. The solution aims to keep template design in MailChimp, minimize errors, and improve scalability.
Nov 30, 2018
1,900 words in the original blog post.
Building digital products requires providing co-workers with a way to edit content, which can be challenging when using traditional CMS systems that are not scalable or compatible across different platforms. The solution lies in serving structured JSON rather than HTML, enabling cross-platform portability and scalability. A headless or API-first CMS provides a complete content infrastructure, allowing for setup of content structures, understanding of content management as building blocks, creation and editing of reusable content structures, connection of content structures into a graph, separation of concerns, and preview mechanisms to enable safe editorial workflows. Additionally, the CMS should provide solutions to script content changes at scale, integrate with other software-as-a-service products, and notify other parts of the infrastructure when content is added or deleted. A scalable cached API, preview API, write or management API, and webhook integration are essential features for a successful content infrastructure.
Nov 29, 2018
2,081 words in the original blog post.
GraphQL is a query language and ecosystem that was launched by Facebook in 2015, providing an expressive way to control retrieved data with a single request, has type-safe API definitions and wide tooling support from big companies like Facebook, Github, Shopify, and more. For backend languages like Python, .Net or Ruby, there hasn't been much adoption of GraphQL API consumption, but Contentful is investing in creating an ecosystem for developers to use GraphQL, introducing GQLi, a GraphQL consumer domain-specific language that allows writing GraphQL queries in native Ruby, providing flexibility and customization. GQLi provides better validation error messages, mutation and subscription capabilities soon, and is actively being worked on with contributions welcome.
Nov 20, 2018
813 words in the original blog post.
The serverless buzzword refers to the ability of developers to deploy HTTP endpoints without worrying about infrastructure, making it possible to write 100 lines of code and test and ship it without incurring costs when the deployed code is not running. The industry is shifting towards specialized services that solve specific problems more efficiently than traditional approaches. To automate certain things when not in control of a service's source code, developers can use APIs and webhooks. Webhooks are HTTP requests sent by a service to a defined HTTP endpoint, allowing connection between services and combination of small functionality pieces into something bigger. When implementing a webhook flow with images in Contentful, a serverless function can be triggered to download the uploaded image, compose it with a company logo, and re-upload it as a watermarked version. The serverless framework is used to develop and deploy functions that run in the cloud, providing an abstraction layer on top of infrastructure providers. With the serverless framework, developers can create HTTP endpoints without jumping between different pages and settings in the AWS console. The deployment logs provide information on where the endpoint is deployed, allowing it to be opened in a browser and seen immediately. To handle Contentful webhooks, the payload definition includes JSON pointers, which make it possible to access the original payload and restructure it according to requirements. Image manipulation can be performed using the Jimp package, which performs image manipulations entirely in JavaScript, without the need for native dependencies. The use case demonstrates how serverless functions can combine different services, such as indexing data with Algolia, and provides a perfect fit for enriching the functionality of a single service or combining multiple services.
Nov 08, 2018
1,838 words in the original blog post.
Static sites are gaining popularity as a viable alternative to database-driven websites, offering speed, security, scalability, and cost-effectiveness. A static site ecommerce built using tools like Jekyll, Contentful, Commerce Layer, GitHub, and Netlify can support enterprise-level features such as multi-country, multi-language online shops with customizable product selection and sorting. The site architecture focuses on separating concerns between code, content, and commerce, allowing developers, content editors, and merchants to work efficiently. With a static site, all pages are plain HTML files served by a CDN, while Commerce Layer API provides dynamic information. The platform can be further improved with features like full-text search, customer accounts, and better content, making it an attractive option for digital agencies and developers looking to build fast and secure ecommerce sites.
Nov 07, 2018
1,580 words in the original blog post.